From 6463c24e1baaf7e7ef9deb4e4b1c6235976b214f Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 24 Apr 2026 11:32:42 +0200 Subject: [PATCH] Skip SSE/polling watchers in iframed Galaxy instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scratchbook windows (WinBox iframes) load the same analysis route (``/datasets/X/display``) as the main page, so each one boots a full Galaxy Vue app. ``historyStore.startWatchingHistory()`` was called unconditionally in ``App.vue::setup()``, meaning every iframe opened its own EventSource to ``/api/events/stream``. With 3 long-lived SSE streams from the main page plus one per iframe, two open dataset windows is enough to saturate the HTTP/1.1 6-connections-per-origin budget and hang the tab — ``test_scratchbook_window_persistence`` hung indefinitely on every CI run of Playwright shard 1. Treat any frame where ``window.top !== window.self`` as embedded, in addition to the existing ``?embed=true`` route-query check. That suppresses history SSE in iframes (and also the existing ``startWatchingEntryPoints`` / ``startWatchingNotifications`` calls, which were already gated on ``!embedded``), leaving the per-origin connection budget untouched at 3 used / 3 free so iframes can still make regular API calls without queueing behind SSE sockets. Verified locally: test passes in 43s with SSE flags on; previously hung past the 5-minute timeout. --- client/src/entry/analysis/App.vue | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/client/src/entry/analysis/App.vue b/client/src/entry/analysis/App.vue index cbc80f181cd..64bd2a784a0 100644 --- a/client/src/entry/analysis/App.vue +++ b/client/src/entry/analysis/App.vue @@ -48,7 +48,7 @@