socket.io-protocol icon indicating copy to clipboard operation
socket.io-protocol copied to clipboard

fix: `waitFor` message latency causing missed packets

Open Totodore opened this issue 2 years ago • 2 comments

This PR fix issue #32. The proposed solution is to extend the ws WebSocket instance to add an async iterator working with the utility function createWebSocketStream coming from the ws library.

It has a minimal impact on the test suite codebase.

Totodore avatar Oct 15 '23 12:10 Totodore

Hi! Thanks for the pull request :+1:

I think it could also be fixed with a buffer, something like this: https://github.com/socketio/socket.io-protocol/commit/49fe300a835d2f90cbc2c058c9ad4cc501c12f43

What do you think?

darrachequesne avatar Oct 17 '23 13:10 darrachequesne

Your solution also work, it has the advantage that it is also working on the browser whereas mine only works for node.js (because it uses the official stream implementation).

This issue also need to be fixed on the engine.io test-suite (I already prepared all the patches with my solution). But if you prefer to do your's, no problem.

Totodore avatar Oct 17 '23 14:10 Totodore