diff --git a/template/server/src/rooms.ts b/template/server/src/rooms.ts index b76835c..fc110af 100644 --- a/template/server/src/rooms.ts +++ b/template/server/src/rooms.ts @@ -337,7 +337,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);