From 8f6886943bb64e1b196ecfe6dc738b5a06f97870 Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Mon, 22 Jun 2026 23:42:54 +0800 Subject: [PATCH] fix(web): limit workbench realtime gap hydration (#1928) --- web/hwlab-cloud-web/src/stores/workbench.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/hwlab-cloud-web/src/stores/workbench.ts b/web/hwlab-cloud-web/src/stores/workbench.ts index 2f81a23e..cc438b9b 100644 --- a/web/hwlab-cloud-web/src/stores/workbench.ts +++ b/web/hwlab-cloud-web/src/stores/workbench.ts @@ -1232,6 +1232,7 @@ function nonBlockingProjection(projection: ProjectionDiagnostic | null): Project } function scheduleRealtimeGapHydration(reason: string): void { + if (!shouldHydrateRealtimeGap(reason)) return; if (typeof window === "undefined") { void hydrateRealtimeGap(reason); return; @@ -1243,6 +1244,12 @@ function nonBlockingProjection(projection: ProjectionDiagnostic | null): Project }, 200); } + function shouldHydrateRealtimeGap(reason: string): boolean { + if (reason.endsWith(":open")) return false; + if (reason.endsWith(":error") || reason === "visibility") return Boolean(activeTurnGapTraceId()); + return true; + } + async function hydrateRealtimeGap(reason: string): Promise { if (shouldSkipActiveTurnRestGap(reason)) { scheduleActiveTurnGapRefresh(reason);