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): either start close timeout or emit destroyed but never both #8956
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
github-actions
bot
requested review from
iCrawl,
kyranet,
SpaceEEC and
vladfrangu
December 20, 2022 17:41
legendhimself
suggested changes
Dec 20, 2022
These changes makes sense and looks good to me. Have you tested these changes? |
Co-authored-by: Voxelli <69213593+legendhimself@users.noreply.github.com>
Qjuh
force-pushed
the
fix-ws-destroy-loop
branch
from
December 20, 2022 19:51
5b4b3a2
to
b1cc99b
Compare
SpaceEEC
approved these changes
Dec 20, 2022
legendhimself
approved these changes
Dec 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Gonna test it on a few bots.
vladfrangu
approved these changes
Dec 24, 2022
kyranet
approved these changes
Dec 25, 2022
legendhimself
added a commit
to legendhimself/discord.js
that referenced
this pull request
Dec 28, 2022
- Fix backport discordjs#7626 missing changes - Reverted the pull request discordjs#8956 - Removed unref of wsCloseTimeout - We are resuming the connection for zombie instead of starting a new Co-authored-by: DraftMan <nicovanaarsen@gmail.com>
legendhimself
added a commit
to legendhimself/discord.js
that referenced
this pull request
Dec 31, 2022
- Fix backport discordjs#7626 missing changes - Reverted the pull request discordjs#8956 - Removed unref of wsCloseTimeout - We are resuming the connection for zombie instead of starting a new Co-authored-by: DraftMan <nicovanaarsen@gmail.com>
kodiakhq bot
pushed a commit
that referenced
this pull request
Jan 1, 2023
* fix: zombie connection - Fix backport #7626 missing changes - Reverted the pull request #8956 - Removed unref of wsCloseTimeout - We are resuming the connection for zombie instead of starting a new Co-authored-by: DraftMan <nicovanaarsen@gmail.com> * refactor: ♻️ Format code and remove useless assignation Co-authored-by: DraftMan <nicovanaarsen@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please describe the changes this PR makes and why it should be merged:
#7626 introduced a
WebSocketShard#wsCloseTimeout()
to listen for zombie connections and reconnect when zombie connections get detected.This fix was going a bit too far, as the timeout was also starting if
WebSocketShard#destroy()
was emitting theWebSocketShard#destroyed
event. In those cases we don't need to listen for zombie connections anymore, as theWebSocketManager
will reconnect the shard anyway.But this lead to the Websocket connection being unneccessarily destroyed after the reconnect, because the timeout happened after the new connection already got made.
This PR now only starts the
wsCloseTimeout
if theWebSocketShard#destroy()
method doesn't emit theWebSocketShard#destroyed
event.Status and versioning classification: