대기실 보완: 만들고 아무도 안 들어간 방도 5분 뒤 정리, 거절된 채팅(도배 방지·빈 메시지)은 nonce를 담아 알려서 "보내는 중" 줄을 지우고 안내
- 회귀 테스트: 서버 2개(수정 전 코드에서 실패 확인), e2e 1단계 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -103,9 +103,11 @@ export class Gateway {
|
||||
if (g?.on) {
|
||||
let b = this.buckets.get(ws.data.connId);
|
||||
if (!b) this.buckets.set(ws.data.connId, (b = new TokenBucket(g.ratePerSec, g.burst)));
|
||||
if (!b.take()) return this.send(ws, { t: 'error', message: '채팅을 너무 빨리 보내고 있어요. 잠깐 쉬었다 보내 주세요.' });
|
||||
if (!b.take()) return this.send(ws, { t: 'error', message: '채팅을 너무 빨리 보내고 있어요. 잠깐 쉬었다 보내 주세요.', n: m.n });
|
||||
}
|
||||
return err(rooms.chat(ws, m.text, m.n));
|
||||
const e = rooms.chat(ws, m.text, m.n);
|
||||
if (e) this.send(ws, { t: 'error', message: e, n: m.n });
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user