혼자인 대기실에서 브라우저 뒤로가기(홈)로 나가면 빈 방이 10분 동안 남던 문제: 다른 사람이 없고 게임 전이면 detach를 나가기로 처리해 방을 바로 닫음. 방 안 📖 규칙도 팝업으로(규칙 페이지로 넘어가며 방을 떠나지 않게), e2e/room-back.e2e.ts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 05:03:12 +09:00
parent b93228e5af
commit 71bdfd201a
6 changed files with 175 additions and 4 deletions

View File

@@ -546,6 +546,9 @@ export class Room {
const u = conn.userId;
if (this.conns.get(u) !== conn) return;
if (this.spectators.has(u)) return this.disconnect(conn);
// Alone in the lobby: nobody to come back to, so leaving the page (뒤로가기, 홈) leaves the room and the empty room
// closes now instead of lingering (2026-10-14). A game (running, or its result: 다시 보기 comes back) keeps the seat.
if (this.status === 'lobby' && this.conns.size === 1 && !this.seatedIds().some((x) => x !== u && !isBotId(x) && !this.leftDuringGame.has(x))) return this.leave(u);
this.conns.delete(u);
this.detached.set(u, conn);
if (this.conns.size === 0) this.becameEmpty('disconnect');