diff --git a/server/src/rooms.ts b/server/src/rooms.ts index feb9c48..4425d71 100644 --- a/server/src/rooms.ts +++ b/server/src/rooms.ts @@ -343,7 +343,8 @@ export class Rooms { return; } if (seat.addr === addr) return; - const key = `${room.id}/${seat.id}`; + // Keyed by the token too: a seat given a new token is noted afresh at once, whoever held it before. + const key = `${room.id}/${seat.id}/${seat.tokenHash}`; const now = Date.now(); if ((this.seenAt.get(key) ?? 0) > now - SEEN_EVERY_MS) return; this.seenAt.set(key, now);