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
I recently upgraded socket.io from 4.5.4 -> 4.7.2 and socket.io-client 4.6.0 -> 4.7.2 (to fix a connection issue caused by a nextJS upgrade). I am now getting a parse error that is disconnecting the socket. When I put a breakpoint in, it is being caused by the (library standard) decoder trying to decode a partial packet (e.g. '2["start-of-my-event-name-' -- note how this is invalid JSON, so the decoder's internal JSON.parse call fails).
This seems very odd. I don't know why it is happening and I suspect it isn't an internal socket.io bug (because I imagine someone else would've experienced it). Does anyone have any thoughts as to why this might be happening?
I am wondering whether Firefox's inability to connect to the websocket (which is weird in itself because this is all local, no nginx involved etc) is causing it to fall back to long polling. Which, in turn, is sending partial packets. Then, for some reason, the client is attempting to parse partial packets as whole packets?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I recently upgraded socket.io from 4.5.4 -> 4.7.2 and socket.io-client 4.6.0 -> 4.7.2 (to fix a connection issue caused by a nextJS upgrade). I am now getting a
parse error
that is disconnecting the socket. When I put a breakpoint in, it is being caused by the (library standard) decoder trying to decode a partial packet (e.g.'2["start-of-my-event-name-'
-- note how this is invalid JSON, so the decoder's internalJSON.parse
call fails).This seems very odd. I don't know why it is happening and I suspect it isn't an internal socket.io bug (because I imagine someone else would've experienced it). Does anyone have any thoughts as to why this might be happening?
I am wondering whether Firefox's inability to connect to the websocket (which is weird in itself because this is all local, no nginx involved etc) is causing it to fall back to long polling. Which, in turn, is sending partial packets. Then, for some reason, the client is attempting to parse partial packets as whole packets?
What are the next best steps for debugging this?
Beta Was this translation helpful? Give feedback.
All reactions