From 663e8ff4a1b07ea8f23e4aad1079acc66861c368 Mon Sep 17 00:00:00 2001 From: byrongamatos Date: Sun, 12 Jul 2026 21:06:04 +0200 Subject: [PATCH] fix(venue-crowd): abort stale stinger state on song load Codex preflight: a stinger straddling a song change could fade back into the previous song's layer or flush its pending loop. Co-Authored-By: Claude Fable 5 --- static/v3/venue-crowd.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/v3/venue-crowd.js b/static/v3/venue-crowd.js index eae4d30..adbbb53 100644 --- a/static/v3/venue-crowd.js +++ b/static/v3/venue-crowd.js @@ -345,7 +345,15 @@ machine.reset(); _prevStreak = 0; _lastAccuracyPct = null; - if (_venueActive && _manifest && !_stingerUntilEnded) { + // Abort any stinger/pending state from the previous song: its ended + // handler must not fade back into the old song's layers. + cancelFade(); + _stingerGen++; + _stingerUntilEnded = false; + _pendingLoop = null; + _loadingLoop = null; + _fadingLoop = null; + if (_venueActive && _manifest) { showLoop(machine.current, FADE_MS); } }