Evicting a Room leaves its spectators' streams open forever #435

Closed
opened 2026-10-15 22:24:06 +00:00 by root · 3 comments
root commented 2026-10-15 22:24:06 +00:00 (Migrated from gitlab.core-project.space)

What happens

When a Room is evicted, its spectators' streams stay open forever with no updates. sweep only deletes the map entry (apps/api/src/room/room.service.ts:371-379) and never ends room.spectators. idleSince only looks at seat connections (:438-446), so a Room can be evicted while people are watching it.

Each orphaned stream holds a connection open on the server, and its viewer sees a frozen board with no message.

Done when

  • Eviction ends every connection of the Room, both seats and spectators, the same way the Room ends them when it closes, so the front shows the Room as gone.
  • Decide, and record in the issue or an ADR, whether watching keeps a Room alive. Either way, a test covers a spectator who is connected when the Room is evicted.
## What happens When a Room is evicted, its spectators' streams stay open forever with no updates. `sweep` only deletes the map entry (`apps/api/src/room/room.service.ts:371-379`) and never ends `room.spectators`. `idleSince` only looks at seat connections (`:438-446`), so a Room can be evicted while people are watching it. Each orphaned stream holds a connection open on the server, and its viewer sees a frozen board with no message. ## Done when - Eviction ends every connection of the Room, both seats and spectators, the same way the Room ends them when it closes, so the front shows the Room as gone. - Decide, and record in the issue or an ADR, whether watching keeps a Room alive. Either way, a test covers a spectator who is connected when the Room is evicted.
root commented 2026-10-15 22:44:10 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 8795b3d3c8

mentioned in commit 8795b3d3c8bf1ad3afde802a1d160a5ba0981d8f
root commented 2026-10-15 22:44:16 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !548

mentioned in merge request !548
root commented 2026-10-15 23:47:44 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit c842db7f70

mentioned in commit c842db7f70cb46f28fb8a1ed7816e357d3d72a9c
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-15 23:54:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amaurycoudr/chess-project#435
No description provided.