From 9c101899f4b8f0c3a7196ae38d6bcbf3ac1b31fe Mon Sep 17 00:00:00 2001 From: David Date: Wed, 20 May 2026 01:15:38 -0400 Subject: [PATCH] fix: reveal tossup answer when all remaining players have buzzed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous check compared `buzzes.length` to the socket count, but `this.buzzes` is never pruned when a player leaves the room. So if a player negged and then left, every subsequent neg would push the buzz count above the remaining socket count, preventing the answer from ever being revealed until the question ran out of words. Switch the condition to "every current socket is in buzzes" — this ignores stale userIds from departed players and correctly handles newly joined players who haven't buzzed yet. Co-Authored-By: Claude Opus 4.7 (1M context) --- quizbowl/TossupRoom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quizbowl/TossupRoom.js b/quizbowl/TossupRoom.js index 2f49aa807..cd477c0f7 100644 --- a/quizbowl/TossupRoom.js +++ b/quizbowl/TossupRoom.js @@ -132,7 +132,7 @@ export const TossupRoomMixin = (QuestionRoomClass) => class extends QuestionRoom case 'reject': this.buzzedIn = null; this.players[userId].updateStats(points, celerity); - if (!this.settings.rebuzz && this.buzzes.length === Object.keys(this.sockets).length) { + if (!this.settings.rebuzz && Object.keys(this.sockets).every(id => this.buzzes.includes(id))) { this.revealTossupAnswer(); Object.values(this.players).forEach(player => { player.tuh++; }); } else {