fix: harden leave room rate limiting

This commit is contained in:
Timo
2026-07-02 00:14:55 +02:00
parent 9fe83f89b2
commit c022f6f490
11 changed files with 52 additions and 32 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ export function startRateLimitCleanup(io) {
}
}
for (const [socketId, entry] of leaveRoomCounts.entries()) {
if (now > entry.resetTime) {
if (now > entry.resetTime || !io.sockets.sockets.has(socketId)) {
leaveRoomCounts.delete(socketId);
}
}