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

Infinite reconnect loop on parse error #1557

Closed
MasterOdin opened this issue Oct 7, 2022 · 1 comment
Closed

Infinite reconnect loop on parse error #1557

MasterOdin opened this issue Oct 7, 2022 · 1 comment
Labels
to triage Waiting to be triaged by a member of the team
Milestone

Comments

@MasterOdin
Copy link

MasterOdin commented Oct 7, 2022

Describe the bug

The socket.io-client would enter an infinite reconnect loop, where each time it would get a parse error. Our backend server was receiving each connection successfully and it did not seem like the client was disconnecting properly when it hit the parse error (because it didn't realize it was connected?).

We traced it and we think the root cause was that we were passing an Error object from @grpc/grpc-js library through socket.io and that it contained a Map<string, Buffer>, but socket.io-client doesn't provide much detail on what's causing the parse error so it's hard for us to concretely say. Having a fix for #1554 would make it easier for us to provide more detail here.

To Reproduce

Please fill the following code example:

Socket.IO server version: 4.5.2
Socket.IO client version: 4.5.2

Expected behavior
A clear and concise description of what you expected to happen.

Platform:

  • Device: [e.g. Samsung S8] macbook
  • OS: [e.g. Android 9.2] macOS
  • Browser: chrome

Additional context

I will try to update this ticket in the next week or so with additional details and code to reproduce that's separate from @grpc/grpc-js.

@MasterOdin MasterOdin added the to triage Waiting to be triaged by a member of the team label Oct 7, 2022
@MasterOdin MasterOdin changed the title parse error causes infinite reconnect loop Infinite reconnect loop on parse error Oct 7, 2022
darrachequesne added a commit that referenced this issue Oct 13, 2022
Following [1], any exception in a user-provided event listener would
get caught in the try...catch of the decoder and result in the
reconnection of the socket.

[1]: c597023

Related:

- #1551
- #1554
- #1557
@darrachequesne
Copy link
Member

This should be fixed by 2403b88, included in version 4.5.3.

Please reopen if needed!

@darrachequesne darrachequesne added this to the 4.5.3 milestone Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage Waiting to be triaged by a member of the team
Projects
None yet
Development

No branches or pull requests

2 participants