diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-21 16:45:31 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-21 16:45:31 +0200 |
| commit | 35545e30303faa517a98ec18c660e5f6c063c912 (patch) | |
| tree | 36f5cf41b1dd1cf34f377804f20b76a462fcd219 /src/lang.rs | |
| parent | make the assistant simpler (diff) | |
| download | senator-sperma-35545e30303faa517a98ec18c660e5f6c063c912.tar.gz senator-sperma-35545e30303faa517a98ec18c660e5f6c063c912.zip | |
Fix voice reconnect race: reuse VoiceClient instead of destroying it
The stale-connection path was calling _remove_voice_client() then
creating a brand-new VoiceClient via channel.connect(). This created a
race: VOICE_SERVER_UPDATE (triggered by Discord when the user joins
voice) arrives between the destroy and the fresh-connect, gets consumed
by the old client, and the new client never receives it — causing a
10s timeout waiting for got_both_voice_updates.
Fix: after disconnect(), call vc.connect() on the same VoiceClient
instance. The disconnect resets the state machine to 'disconnected'
but the same VoiceConnectionState processes any events that arrive
between disconnect and reconnect, so the state machine correctly
reaches got_both_voice_updates.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
