From df4cdf7f9ba06e58d511e45d95b5dfb7f75feb84 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Tue, 23 Jun 2026 07:49:46 -0400 Subject: [PATCH] Prevent stale cross-bucket rows during source-tab switches --- static/sessions.js | 1 + tests/test_issue4766_sidebar_source_pushdown.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/static/sessions.js b/static/sessions.js index ac172c10..72a6aa46 100644 --- a/static/sessions.js +++ b/static/sessions.js @@ -1658,6 +1658,7 @@ function _setSessionSourceFilter(filter) { _selectedSessions.clear(); _sessionSelectMode = false; try { localStorage.setItem('hermes-session-source-filter', next); } catch (_e) {} + renderSessionListFromCache(); void renderSessionList({deferWhileInteracting:false}); } diff --git a/tests/test_issue4766_sidebar_source_pushdown.py b/tests/test_issue4766_sidebar_source_pushdown.py index 3f18a5a7..869bec5c 100644 --- a/tests/test_issue4766_sidebar_source_pushdown.py +++ b/tests/test_issue4766_sidebar_source_pushdown.py @@ -286,6 +286,9 @@ global.localStorage = {{ this.writes.push([key, value]); }}, }}; +global.renderSessionListFromCache = () => {{ + renderCalls.push('cache'); +}}; global.renderSessionList = (opts) => {{ renderCalls.push(opts); return Promise.resolve(); @@ -308,7 +311,7 @@ console.log(JSON.stringify({{ assert body["selectedSize"] == 0 assert body["sessionSelectMode"] is False assert body["storageWrites"] == [["hermes-session-source-filter", "cli"]] - assert body["renderCalls"] == [{"deferWhileInteracting": False}] + assert body["renderCalls"] == ["cache", {"deferWhileInteracting": False}] @pytest.mark.skipif(NODE is None, reason="node not on PATH")