대기실 보완: 만들고 아무도 안 들어간 방도 5분 뒤 정리, 거절된 채팅(도배 방지·빈 메시지)은 nonce를 담아 알려서 "보내는 중" 줄을 지우고 안내
- 회귀 테스트: 서버 2개(수정 전 코드에서 실패 확인), e2e 1단계 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,8 @@ export class RoomManager {
|
||||
const cfg = applyConfigPatch({ ...DEFAULT_ROOM_CONFIG, title: `${nick}님의 방`.slice(0, 40) }, init);
|
||||
if (typeof cfg === 'string') return cfg;
|
||||
const room = new Room(this.newCode(), hostId, cfg, this.deps);
|
||||
// Empty until someone joins: a room created and never entered expires like any empty room.
|
||||
room.emptySince = Date.now();
|
||||
this.rooms.set(room.code, room);
|
||||
this.deps.log?.('room created', { code: room.code, host: hostId });
|
||||
return room;
|
||||
@@ -294,7 +296,7 @@ export class RoomManager {
|
||||
const room = this.roomOf(ws.data.userId);
|
||||
if (!room || ws.data.roomCode !== room.code) return '방에 들어가 있지 않아요.';
|
||||
const t = text.replace(/[\u0000-\u001f\u007f]/g, ' ').trim();
|
||||
if (!t) return null;
|
||||
if (!t) return '빈 메시지는 보낼 수 없어요.';
|
||||
room.say(ws.data.userId, t, n);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user