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

Improve shard reconnection handling #696

Merged
merged 3 commits into from
Feb 22, 2025

Conversation

abitofevrything
Copy link
Member

Description

It seems like some bots are experiencing random disconnections that nyxx is not considering as unexpected (which would cause a reconnect). This means the bot effectively goes offline, but is left in a limbo state where the client is still active.

Im not sure why the reconnect loop isn't triggering. This PR will be updated as I find more problems in the code; for now it only contains a fix the the localCloseCode being set even when Discord closes the connection (causing a race condition of sorts for detecting error close codes).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Ran dart analyze or make analyze and fixed all issues
  • Ran dart format --set-exit-if-changed -l 160 ./lib or make format and fixed all issues
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@abitofevrything abitofevrything added the bug Something isn't working label Sep 9, 2024
@abitofevrything abitofevrything self-assigned this Sep 9, 2024
@l7ssha l7ssha added this to the 6.4.0 milestone Sep 13, 2024
@l7ssha l7ssha modified the milestones: 6.4.0, 6.5.0 Oct 4, 2024
@abitofevrything abitofevrything force-pushed the bug/remote-close-undetected branch 2 times, most recently from 8110fa5 to c909bc3 Compare October 5, 2024 18:40
@l7ssha l7ssha removed this from the 6.5.0 milestone Oct 10, 2024
@abitofevrything abitofevrything force-pushed the bug/remote-close-undetected branch from 4d641f2 to 204df18 Compare February 14, 2025 09:55
@abitofevrything abitofevrything marked this pull request as ready for review February 22, 2025 10:25
@abitofevrything abitofevrything added this to the 6.6.0 milestone Feb 22, 2025
@abitofevrything abitofevrything changed the title Don't set local close code when remote closes the connection Improve shard reconnection handling Feb 22, 2025
@abitofevrything abitofevrything merged commit 4ffa11d into main Feb 22, 2025
5 checks passed
@abitofevrything abitofevrything deleted the bug/remote-close-undetected branch February 22, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants