Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(WebSocket): buffer sending the data until connection is open #678

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

kettanaito
Copy link
Member

When fixing the tests for our Socket.IO bunding, I've discovered that client.send() dispatches the message event on the WebSocket client immediately. If the client connection is still CONNECTING at the point, the message will be lost.

Changes

  • client.send() schedules data send for once the connection is open if it's not yet.
  • client.send() does nothing if the connection is CLOSING or CLOSED.

@kettanaito kettanaito changed the title fix(WebSocket): buffer sends until connection is open fix(WebSocket): buffer sending the data until connection is open Nov 18, 2024
@kettanaito kettanaito merged commit eaf7182 into main Nov 18, 2024
2 checks passed
@kettanaito kettanaito deleted the fix/ws-send-after-open branch November 18, 2024 12:09
@kettanaito
Copy link
Member Author

Released: v0.37.1 🎉

This has been released in v0.37.1!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant