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 buffering before open on FakeWebsocket #212

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

MarcusLongmuir
Copy link
Collaborator

@MarcusLongmuir MarcusLongmuir commented Jan 27, 2025

This PR fixes an issue where in some uses of FakeWebsocket such as running a NetworkedDOM document locally in browser the messages sent to the client side of the socket would be missed because the socket would be constructed and passed to the server and sent-to before the client had started listening for messages.

The fix is to wait for the client to be listening for message events and buffer the events received before then and dispatch them after the listener is added.


What kind of changes does your PR introduce? (check at least one)

  • Bugfix

Does your PR introduce a breaking change? (check one)

  • No

Does your PR fulfill the following requirements?

  • All tests are passing

Copy link

github-actions bot commented Jan 27, 2025

🪓 PR closed, deleted preview at https://github.com/mml-io/mml/tree/gh-pages/pull/212/

@MarcusLongmuir MarcusLongmuir merged commit 66f808a into main Jan 27, 2025
9 checks passed
@MarcusLongmuir MarcusLongmuir deleted the bugfix/fake-websocket-buffering branch January 27, 2025 20:37
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.

2 participants