Improve Engine.IO v4 polling compatibility and modernize internal typing and transport handling#60
Open
reinbeumer wants to merge 3 commits into
Open
Improve Engine.IO v4 polling compatibility and modernize internal typing and transport handling#60reinbeumer wants to merge 3 commits into
reinbeumer wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves Engine.IO v4 polling compatibility and also includes a broader internal modernization of
socket.io-dart.The original goal was to fix polling interoperability issues with newer Engine.IO / Socket.IO clients. While implementing and validating those fixes, I also cleaned up related transport/server internals, introduced stronger internal typing, and expanded test coverage in the same areas.
Main functional fixes
1. Polling payload decoding
The polling transport now handles both of the payload formats that were relevant during testing:
\x1e)Packets are decoded individually, and close packets are handled consistently.
2. CORS preflight handling
Browser polling clients can issue
OPTIONSpreflight requests before pollingGET/POSTrequests.This branch updates request verification and polling/XHR handling so those preflight requests are accepted and answered correctly.
3. HTTP response lifecycle handling
Some error and edge-case response paths now close responses more explicitly to avoid hanging clients.
Where response closing is intentionally fire-and-forget, the code uses
unawaited(...).Additional internal improvements
In addition to the polling fixes, this branch also includes a broader set of related internal improvements:
These changes were made in the same branch because the polling fixes touched areas that were also being actively cleaned up and made more type-safe.
What reviewers should expect
This is a larger PR than an ideal narrowly scoped bugfix PR.
It includes both:
If preferred, I can split out the polling-specific changes into a smaller follow-up PR with a reduced review surface.
Testing
Polling-related behavior was covered with integration-style tests for:
Also verified with:
Compatibility
Notes
I understand this PR may still be broader than what you would ideally want for review. If you prefer a smaller change set, I am happy to prepare a reduced PR focused only on the polling compatibility fixes.