From 406ca28304bee5d3796e630be915df2598bec3f3 Mon Sep 17 00:00:00 2001 From: Smittix Date: Mon, 23 Feb 2026 21:01:59 +0000 Subject: [PATCH] fix: suppress stale WebSocket close message after stopping waterfall stop() sets _ws = null before the async onclose fires, so the handler now early-returns when _ws is null instead of showing the misleading "WebSocket closed before ready" retry message. Co-Authored-By: Claude Opus 4.6 --- static/js/modes/waterfall.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/modes/waterfall.js b/static/js/modes/waterfall.js index 879e146..581116f 100644 --- a/static/js/modes/waterfall.js +++ b/static/js/modes/waterfall.js @@ -2996,6 +2996,8 @@ const Waterfall = (function () { }; _ws.onclose = () => { + // stop() sets _ws = null before the async onclose fires. + if (!_ws) return; if (!_wsOpened && _active) { // Wait for timeout-based fallback; avoid flapping to SSE on brief close/retry. _setStatus('WebSocket closed before ready. Waiting to retry/fallback...');