Repository navigation
Reconnect to Discord and resync the voice channel - #300
Merged
Merged
Conversation
Any socket error or close now clears the shown users and reconnects with backoff (2, 5, 15, then 30 s, at most two connections a minute) instead of silently keeping stale data. While connected, the selected voice channel is re-read every 20 s, which also catches missed channel switches; two unanswered reads count as a lost connection.
Only read errors, an empty message and a close count as a lost connection. Ping, pong and binary frames are ignored like before.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was previously deployed
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
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.
When Discord restarts while Overlayed is running the overlay keeps the old channel forever. Mine showed me alone and muted while two people were in the call, and Overlayed had no connection to 127.0.0.1:6463 anymore. The websocket plugin reports a dropped connection as a plain error string and the manager only checks for
Connection reset without closing handshake, so any other error just gets ignored and nothing reconnectsNow a read error, close or failed send clears the users and reconnects with backoff (2s, 5s, 15s, then every 30s, at most two connections a minute) without going to the error page or unpinning. The first connect at startup still shows the error page like before but keeps retrying in the background
While connected it also asks for the selected voice channel every 20s and reconciles channel and members, keeping who is talking. Two unanswered requests count as a lost connection. 20s is a judgment call, I can change it. This should also pick up the private call switch from #285 and the admin move from #232, but I havent checked either against real Discord
Tested with a mocked socket for errors, close, pings, channel switches, member changes, missed replies and repeated drops. Live on Windows it holds one connection and shows the right people, the Discord restart itself only went through the mock so far