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(WebSocketShard): clear listeners on reconnect #8927

Merged
merged 1 commit into from Dec 14, 2022

Conversation

Qjuh
Copy link
Contributor

@Qjuh Qjuh commented Dec 13, 2022

Please describe the changes this PR makes and why it should be merged:
This PR should solve resolve #8486 and maybe even resolve #8592

When a WebSocketShard doesn't receive a heartbeat in time it tries to close the Websocket. If the close event of the socket doesn't emit in time either it assumes a zombie connection and emits its own close event, but the old connection still has the onClose and other event listeners attached. So if the old Websocket finally emits the close event the WebSocketShard receives that event and assumes it's from the new (re-)connection and closes again.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Dec 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Dec 13, 2022 at 7:18PM (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Dec 13, 2022 at 7:18PM (UTC)

Copy link
Contributor

@legendhimself legendhimself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bot stop working after 2-3 hours of work Bot randomly exiting process or going offline/unresponsive
7 participants