You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
websocket: send callbacks are not all called if multiple messages are sent rapidly #698
When using the websocket transport, if socket.send() is called multiple times in the same tick with a callback provided, some of the callbacks may not be called even though the messages were sent.
connection
callback 1 called
callback 2 called
callback 3 called
callback 4 called
Instead it logs:
connection
callback 1 called
callback 2 called
It does log callback 3 called after about 25 seconds, and callback 4 called 25 seconds later — enabling debug logs shows that ping packets are triggering those late callbacks.
The client logs that the messages are all received immediately.
Platform:
Device: M1 MacBook Pro
OS: macOS Sonoma 14.2
Additional context
There is an existing test that is supposed to check this scenario. However it does not expose this bug, because it does not specify a transport and defaults to polling, which also makes it redundant with the next test. That first test also only sends two messages, when the test program above shows that only the third and further callbacks are delayed.
changed the title [-]`websocket`: `send` callbacks are not all called if multiple packets are sent rapidly[/-][+]`websocket`: `send` callbacks are not all called if multiple messages are sent rapidly[/+]on Feb 23, 2024
Activity
Add failing tests showing the issue in socketio#698
Fix socketio#698 by setting supportsFraming to false for all transports
test: add failing tests showing the issue in socketio#698
fix: Fix socketio#698 by setting supportsFraming to false for all tra…
[-]`websocket`: `send` callbacks are not all called if multiple packets are sent rapidly[/-][+]`websocket`: `send` callbacks are not all called if multiple messages are sent rapidly[/+]fix: fix `websocket` and `webtransport` send callbacks (#699)
darrachequesne commentedon Jun 22, 2024
This should be fixed by fc21c4a, included in version 6.6.0. Thanks!