fix(web): limit workbench realtime gap hydration (#1928)
This commit is contained in:
@@ -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<void> {
|
||||
if (shouldSkipActiveTurnRestGap(reason)) {
|
||||
scheduleActiveTurnGapRefresh(reason);
|
||||
|
||||
Reference in New Issue
Block a user