Repository navigation
fix(web): notify subscribers when late fallbackDuration updates playback store - #2988
Merged
richiemcilroy merged 2 commits intoOct 23, 2026
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2931 / #2932, addressing @richiemcilroy's feedback in #2975 regarding late
fallbackDurationupdates.Problem
When
PlaybackProvideris mounted with an initial fallback (e.g.0ornullbefore recording metadata finishes loading),TimelineViewsubscribes viaplayback.subscribe(...)and initializes its duration state toplayback.getDuration()(0).When the async video metadata resolves and
PlaybackProvider'suseEffectinvokesstore.setFallbackDuration(next), the store previously updatedfallbackanddurationinternally without emitting an update totimeSubscribers. Consequently:TimelineViewwas not notified of the new duration and remained in a zero-duration state ([0, 0]).Fix
playback-store.ts(setFallbackDuration), comparegetDuration()before and after applying the normalized fallback duration.emitTime()to notify subscribers soTimelineView(and any other subscribers) can synchronize their duration state.getDuration()did not change (e.g. identical value or video element already has finite duration), remain silent.Testing
Added two unit tests to
apps/web/__tests__/unit/playback-store.test.ts:fallbackDurationchanges the store duration from 0 to 60.fallbackDurationdoes not change the total duration (e.g. element already loaded with finite duration).

Confidence Score: 5/5
The PR appears safe to merge.Summary
The PR notifies playback subscribers when a late fallback changes the duration returned by
getDuration().No actionable issues found. Tests were inspected, not run.
Reviews (1) · Last reviewed commit: "fix(web): notify subscribers when late f..." · Reviewed by Greptile