fix: Bug - Voice states doesn't get cleared for all users on leave

Broadcast a cleared voice_state when voice-active sockets drop and reset mute/deafen flags on disconnect or reconnect so stale session state cannot leak to other clients.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 01:00:01 +02:00
parent e75b4a38ed
commit 29032b5a36
8 changed files with 443 additions and 29 deletions

View File

@@ -373,8 +373,8 @@ describe('users reducer - status', () => {
presenceServerIds: ['s1'],
voiceState: {
isConnected: true,
isMuted: false,
isDeafened: false,
isMuted: true,
isDeafened: true,
isSpeaking: true,
roomId: 'voice-1',
serverId: 's1'
@@ -390,6 +390,8 @@ describe('users reducer - status', () => {
expect(state.entities['u6']?.presenceServerIds).toBeUndefined();
expect(state.entities['u6']?.isOnline).toBe(false);
expect(state.entities['u6']?.voiceState?.isConnected).toBe(false);
expect(state.entities['u6']?.voiceState?.isMuted).toBe(false);
expect(state.entities['u6']?.voiceState?.isDeafened).toBe(false);
expect(state.entities['u6']?.voiceState?.roomId).toBeUndefined();
});
});