From 02af12e9d98f130321bb0c1b1c92110418fb8a05 Mon Sep 17 00:00:00 2001 From: Christian Pillsbury Date: Tue, 23 Jun 2026 11:59:10 -0700 Subject: [PATCH] refactor(spf): drop vestigial try/catch in syncLiveSeekableRange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setLiveSeekableRange throws only on a non-'open' readyState or an invalid range. The readyState is checked synchronously immediately before the call (no await between, so it can't change), and liveWindowFor guarantees 0 <= start <= end — neither throw vector is reachable. The try/catch was load-bearing pre-split (it also wrapped a duration write that could throw mid-append); that write is gone, leaving the catch dead. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../behaviors/dom/sync-live-seekable-range.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/spf/src/playback/behaviors/dom/sync-live-seekable-range.ts b/packages/spf/src/playback/behaviors/dom/sync-live-seekable-range.ts index 7212b4ce..6b71efd6 100644 --- a/packages/spf/src/playback/behaviors/dom/sync-live-seekable-range.ts +++ b/packages/spf/src/playback/behaviors/dom/sync-live-seekable-range.ts @@ -49,13 +49,12 @@ function syncLiveSeekableRangeSetup({ const liveWindow = liveWindowFor(state.presentation.get(), state.selectedVideoTrackId?.get()); if (!mediaSource || mediaSource.readyState !== 'open' || !liveWindow) return; - try { - // Re-declared as the window slides so seekable tracks the live window - // (the full DVR range remains seekable; seek-to-live-edge starts near the edge). - mediaSource.setLiveSeekableRange(liveWindow.start, liveWindow.end); - } catch { - // readyState raced closed — retried on the next window change. - } + // Re-declared as the window slides so seekable tracks the live window + // (the full DVR range remains seekable; seek-to-live-edge starts near the edge). + // No try/catch: `setLiveSeekableRange` throws only on a non-'open' readyState + // (checked synchronously just above — no await between, so it can't change) or + // an invalid range (`liveWindowFor` guarantees 0 ≤ start ≤ end). + mediaSource.setLiveSeekableRange(liveWindow.start, liveWindow.end); }); }