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);