Skip to content

Reconnect to Discord and resync the voice channel - #300

Merged
Hacksore merged 2 commits into
overlayeddev:mainfrom
mardausdennis:285_rpc-reconnect
Oct 10, 2026
Merged

Hacksore merged 2 commits into
overlayeddev:mainfrom
mardausdennis:285_rpc-reconnect

Conversation

@mardausdennis

Copy link
Copy Markdown
Contributor

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 reconnects

Now 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

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.
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
overlayed Skipped Skipped Oct 6, 2026 7:47pm UTC

Request Review

@Hacksore
Hacksore merged commit ec3aa31 into overlayeddev:main Oct 10, 2026
8 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 1440702f Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants