mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-30 20:49:22 +00:00
fix(release): close remaining PR review gaps
This commit is contained in:
@@ -2172,6 +2172,9 @@ async function handleServerEvent(event, data, expectedConnectionGeneration = con
|
||||
break;
|
||||
}
|
||||
case EVENTS.CONTROL_MODE:
|
||||
// Terminal room teardown is authoritative. Older/custom relays may
|
||||
// still emit a trailing role update after ROOM_CLOSED.
|
||||
if (!currentRoom) break;
|
||||
// Host Control Mode changed (toggle or host-leave fallback).
|
||||
controlMode = data.controlMode || CONTROL_MODES.EVERYONE;
|
||||
hostPeerId = data.hostPeerId || null;
|
||||
@@ -2239,7 +2242,7 @@ async function handleServerEvent(event, data, expectedConnectionGeneration = con
|
||||
await chatReceiveQueue;
|
||||
break;
|
||||
}
|
||||
case EVENTS.ERROR:
|
||||
case EVENTS.ERROR: {
|
||||
isConnecting = false;
|
||||
const terminalRoomError = data.code === ERROR_CODES.ROOM_CLOSED
|
||||
|| data.code === ERROR_CODES.PEER_TIMED_OUT
|
||||
@@ -2274,6 +2277,7 @@ async function handleServerEvent(event, data, expectedConnectionGeneration = con
|
||||
const errStatusMsg = { type: 'JOIN_STATUS', success: false, message: data.message };
|
||||
await broadcastJoinStatus(errStatusMsg);
|
||||
break;
|
||||
}
|
||||
case EVENTS.PLAY:
|
||||
case EVENTS.PAUSE:
|
||||
case EVENTS.SEEK:
|
||||
|
||||
@@ -116,11 +116,17 @@ describe('target tab lifecycle', () => {
|
||||
expect(backgroundSource).toContain("data.message === 'Removed from room after inactivity'");
|
||||
expect(backgroundSource).toContain('await endRoomSession({ reason: `Room session ended: ${data.message}` });');
|
||||
|
||||
const controlModeStart = backgroundSource.indexOf('case EVENTS.CONTROL_MODE:');
|
||||
const controlModeEnd = backgroundSource.indexOf('case EVENTS.ROOM_LIST:', controlModeStart);
|
||||
expect(backgroundSource.slice(controlModeStart, controlModeEnd)).toContain('if (!currentRoom) break;');
|
||||
|
||||
expect(sharedConstantsSource).toContain("ROOM_CLOSED: 'room_closed'");
|
||||
expect(sharedConstantsSource).toContain("PEER_TIMED_OUT: 'peer_timed_out'");
|
||||
expect(serverSource).toContain('code: ERROR_CODES.ROOM_CLOSED');
|
||||
expect(serverSource).toContain('code: ERROR_CODES.PEER_TIMED_OUT');
|
||||
expect(serverSource).toContain("removePeerFromRoom(sid, roomId, 'room-timeout')");
|
||||
expect(serverSource).toContain(
|
||||
"removePeerFromRoom(sid, roomId, 'room-timeout', { notifyRemainingPeers: false })"
|
||||
);
|
||||
});
|
||||
|
||||
it('does not promote a nested media target without confirmed parent visibility', () => {
|
||||
|
||||
Reference in New Issue
Block a user