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 reconnection handling in the chat demo app #4189

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

mixaildudin
Copy link
Contributor

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

The source code of the example app examples/chat implies that reconnetion status (failure or success) is shown to the user.
In fact, it's not, because the reconnection events are listened to incorrectly: you're supposed to listen to the Manager's events like socket.io.on(...), not just socket.on(...).

I only wanted to take a look at how to handle disconnections and do reconnections, but here is what it came down to :)

New behavior

The example works as it's supposed to, you can now see messages like "attempt to reconnect has failed" in the UI.

Other information (e.g. related issues)

Also updated README in the example: it says you need to run npm ci to install packages, but since lockfiles are gitignored in the example folder, you actually need to run npm i

@mixaildudin mixaildudin changed the title Fix chat demo app Fix reconnection handling in the chat demo app Nov 28, 2021
@darrachequesne darrachequesne merged commit 7a70f63 into socketio:master Nov 30, 2021
@darrachequesne
Copy link
Member

Good catch, thanks 👍

dzad pushed a commit to dzad/socket.io that referenced this pull request May 29, 2023
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.

2 participants