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): do not call public "server.send()" in message forwarding #650

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

kettanaito
Copy link
Member

MSW proxies the server.send() method to log a message whenever the user is sending something from the mock to the server. But since Interceptors also call server.send() during the message forwarding, the logs display an entry as if the user has called server.send().

Fix this by wrapping the send mechanism in a private method and calling that private method during the forwarding.

@kettanaito kettanaito merged commit befd772 into main Oct 1, 2024
2 checks passed
@kettanaito kettanaito deleted the fix/ws-server-forwarding branch October 1, 2024 14:51
@kettanaito
Copy link
Member Author

Released: v0.36.1 🎉

This has been released in v0.36.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