FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

improve gateway stability against new discord error conditions by akiraveliara · Pull Request #2455 · DSharpPlus/DSharpPlus · GitHub

improve gateway stability against new discord error conditions - #2455

Merged
akiraveliara merged 4 commits into
masterfrom
aki/fix-shards-dying-on-invalid-hello
Aug 19, 2026
Merged

akiraveliara merged 4 commits into
masterfrom
aki/fix-shards-dying-on-invalid-hello

Conversation

akiraveliara commented Aug 5, 2026 •
edited
Loading

Copy link
Copy Markdown
Member
  • if we received an invalid HELLO (or probably also READY) event, DSharpPlus would trigger the resume procedure. if the shard never successfully connected, this is fine, because the resume URL and session ID will be null and it'll trigger a hard reconnect, but if it did successfully connect before, it would reuse that resume URL and session ID for a resume attempt that may now be invalid. this would cause shards to stall infinitely in an attempt to resume before a session was established in the first place

  • if discord closed the gateway without an error code, DSharpPlus would crash the shard. we will now attempt to resume.

  • if discord sent an invalid gateway payload, DSharpPlus would crash the shard to restart from a clean slate. it now waits for five consecutive invalid events before rendering judgement so as to allow for transient errors

  • MultiShardOrchestrator would previously always immediately reconnect a failed shard without considering that many shards can fail at once. this adds a concurrency limit (currently of 1, since the actual gateway concurrency limit is more perfidious and 1 should guarantee success) to multi-sharded reconnects

  • This pull request did not involve AI in any way

  • All features in this pull request were tested.

this PR initially only intended to fix the first issue, but the list has grown

akiraveliara added this to the v5.0 milestone Aug 5, 2026
akiraveliara changed the title fix shards dying on receiving an invalid hello event improve gateway stability against new discord error conditions Aug 10, 2026
akiraveliara merged commit 29fab19 into master Aug 19, 2026
1 check passed
akiraveliara deleted the aki/fix-shards-dying-on-invalid-hello branch August 19, 2026 17:36
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL