diff --git a/deps/cloudxr/webxr_client/helpers/react/CloudXRComponent.tsx b/deps/cloudxr/webxr_client/helpers/react/CloudXRComponent.tsx index 8b6b514640..9a7b184a36 100644 --- a/deps/cloudxr/webxr_client/helpers/react/CloudXRComponent.tsx +++ b/deps/cloudxr/webxr_client/helpers/react/CloudXRComponent.tsx @@ -151,7 +151,8 @@ interface CloudXRComponentProps { * only whether the resulting synthetic error gets retried depends on `reconnect`. Doubles on * every reconnect attempt (this value, then x2, then x4, ...) so a connection that's genuinely * just slow, not stuck, gets more time on each retry instead of being cut off at the same fixed - * threshold every attempt. Defaults to STREAM_ATTACH_BASE_TIMEOUT_MS (2 minutes). + * threshold every attempt. Defaults to STREAM_ATTACH_BASE_TIMEOUT_MS (2 minutes). A value <= 0 + * disables this detection. */ streamAttachTimeoutMs?: number; @@ -166,7 +167,8 @@ interface CloudXRComponentProps { * message. Like warmupEndTimeoutMs, does NOT grow per reconnect attempt - warm-up is a fast, * bounded server-side priming step once the stream has attached at all, not something that * legitimately takes longer under retry the way the initial attach can. Defaults to - * WARMUP_BEGIN_BASE_TIMEOUT_MS (10 seconds). + * WARMUP_BEGIN_BASE_TIMEOUT_MS (10 seconds). A value <= 0 disables this detection, as does + * warmupEndTimeoutMs <= 0. */ warmupBeginTimeoutMs?: number; @@ -176,7 +178,8 @@ interface CloudXRComponentProps { * the first warm-up log arrives and cleared by WARMUP_COMPLETE_LOG_PATTERN). See * warmupBeginTimeoutMs's doc comment for why this is a separate deadline. Does NOT grow per * reconnect attempt, for the same reason warmupBeginTimeoutMs doesn't. Defaults to - * WARMUP_END_BASE_TIMEOUT_MS (30 seconds). + * WARMUP_END_BASE_TIMEOUT_MS (30 seconds). A value <= 0 disables this detection and + * warmupBeginTimeoutMs too (all warm-up detection); stream-attach detection is unaffected. */ warmupEndTimeoutMs?: number; @@ -357,6 +360,8 @@ export default function CloudXRComponent({ */ const armStreamAttachTimer = useCallback( (cxrSession: CloudXR.Session) => { + // <= 0 disables detection; setTimeout(fn, 0) would fire immediately instead. + if (streamAttachBaseTimeoutMs <= 0) return; const attemptForThisTimer = reconnectAttemptRef.current; const attachTimeoutMs = Math.min( streamAttachBaseTimeoutMs * 2 ** attemptForThisTimer, @@ -397,6 +402,8 @@ export default function CloudXRComponent({ */ const armWarmupBeginTimer = useCallback( (cxrSession: CloudXR.Session) => { + // warmupEndTimeoutMs <= 0 turns off all warm-up detection; the begin timer only hands off to the end timer. + if (warmupBeginBaseTimeoutMs <= 0 || warmupEndBaseTimeoutMs <= 0) return; // Same overflow guard as armStreamAttachTimer: an uncapped delay above setTimeout's // ~24.8-day int32 limit wraps and fires near-immediately instead of waiting. const timeoutMs = Math.min(warmupBeginBaseTimeoutMs, MAX_SET_TIMEOUT_MS); @@ -416,7 +423,7 @@ export default function CloudXRComponent({ } as CloudXR.StreamingError); }, timeoutMs); }, - [warmupBeginBaseTimeoutMs] + [warmupBeginBaseTimeoutMs, warmupEndBaseTimeoutMs] ); /** @@ -429,6 +436,7 @@ export default function CloudXRComponent({ */ const armWarmupEndTimer = useCallback( (cxrSession: CloudXR.Session) => { + if (warmupEndBaseTimeoutMs <= 0) return; // disabled, see armStreamAttachTimer const timeoutMs = Math.min(warmupEndBaseTimeoutMs, MAX_SET_TIMEOUT_MS); warmupEndTimerRef.current = setTimeout(() => { warmupEndTimerRef.current = null; diff --git a/deps/cloudxr/webxr_client/src/config/params.ts b/deps/cloudxr/webxr_client/src/config/params.ts index 662ec019c8..d98b622af9 100644 --- a/deps/cloudxr/webxr_client/src/config/params.ts +++ b/deps/cloudxr/webxr_client/src/config/params.ts @@ -265,21 +265,21 @@ export const URL_PARAMS: UrlParam[] = [ elementId: 'cloudxrStreamAttachTimeoutMs', isValid: isNumber, description: - 'Base timeout for detecting a stream that never attaches ("passthrough-only"), in milliseconds. Independent of retry.', + 'Base timeout for detecting a stream that never attaches ("passthrough-only"), in milliseconds. Independent of retry. 0 disables.', }, { key: 'warmupBeginTimeoutMs', elementId: 'cloudxrWarmupBeginTimeoutMs', isValid: isNumber, description: - 'Timeout for detecting a stream that attached but produced no decoder warm-up signal at all, in milliseconds. Does not grow on retry.', + 'Timeout for detecting a stream that attached but produced no decoder warm-up signal at all, in milliseconds. Does not grow on retry. 0 disables.', }, { key: 'warmupEndTimeoutMs', elementId: 'cloudxrWarmupEndTimeoutMs', isValid: isNumber, description: - 'Timeout for detecting decoder warm-up that began but never finished, in milliseconds. Does not grow on retry.', + 'Timeout for detecting decoder warm-up that began but never finished, in milliseconds. Does not grow on retry. 0 disables all warm-up detection, including the begin timeout.', }, { key: 'proxyUrl', diff --git a/deps/cloudxr/webxr_client/src/index.html b/deps/cloudxr/webxr_client/src/index.html index b2d3e0c9f7..dd8d08de1d 100644 --- a/deps/cloudxr/webxr_client/src/index.html +++ b/deps/cloudxr/webxr_client/src/index.html @@ -1563,8 +1563,8 @@