The template's room server guards a stale room once, by name; the test's tick helper is named for what it waits on; the port list and the hall's tally lose a set that was always empty

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
Eric WagonerandClaude Fable 5.1 committed 2026-10-26 22:38:08 -04:00
1 parent 62cb00be33
commit 75428b5a9b
4 files changed
+15 -13

No files matched your search

+7 -4
View File
@@ -361,10 +361,14 @@ export class Rooms<State, Input> {
* to hang and the bot's to come at once. The table is told as each move
* lands, the same as any other.
*/
/** A room forgotten and loaded again drives itself; a timer or tick that wakes with the old one must do nothing. */
private isTable(room: Room<State>): boolean {
return this.rooms.get(room.id) === room;
}
private botsAfterAnswering(room: Room<State>): void {
setImmediate(() => {
// A room forgotten and loaded again drives itself; this one is no longer the table.
if (this.rooms.get(room.id) !== room) return;
if (!this.isTable(room)) return;
try {
this.driveBots(room);
this.botsSpeak(room, 'phase');
@@ -403,8 +407,7 @@ export class Rooms<State, Input> {
const hurried = this.hurried.has(room.id);
const next = setTimeout(() => {
this.pacing.delete(room.id);
// A room forgotten and loaded again drives itself; this one is no longer the table.
if (this.rooms.get(room.id) !== room) return;
if (!this.isTable(room)) return;
this.driveBots(room, hurried ? HURRIED_STEP : 1);
// Played out: the bots have their say once, as after any round, which ends a game with parting words.
if (!this.pacing.has(room.id)) this.botsSpeak(room, 'phase');