fix(phone): stop in-place reload from writing progress under the next episode - #251
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(phone): stop in-place reload from writing progress under the next episode#251cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
publishLoadingState retargets contentId immediately on in-place reloads (auto-advance, On Deck, version switch) while position and versions still belong to the previous item. onExit then persisted that timestamp under the next episode's id. Keep the last Ready (contentId, fileId) and use it for the durable write while a load is still pending. Co-authored-by: Quick <Quick104@users.noreply.github.com>
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.
Bug and impact
During an in-place phone player reload (auto-advance, On Deck, version switch), backing out while the next item is still loading could persist the previous episode's timestamp under the next episode's content id.
Concrete trigger: watch episode A, auto-play starts loading episode B, hit Back during the loading spinner. Episode B then resumes at episode A's position.
Root cause
publishLoadingStateretargetscontentIdimmediately but leavespositionandversionson the previous item until Ready.onExitsubmittedfinalPlaybackPositionWriterusing that mix of identities.onPositionChangedalready ignores samples whilepositionReportsBlockedForPendingLoadis set. PR #241 guards the matching hole inonPlayingChanged. This is the remaining durable-write sink on the same transition.Fix
Remember the last Ready
(contentId, fileId)and, when a load is still pending, attribute the exit write to that identity instead of the loading target. Same-content recovery still writes the previous item correctly rather than dropping the snapshot.Validation
PlayerViewModelLoadOwnershipIntegrationTest.exitDuringInPlaceReloadWritesPreviousItemNotTheLoadingTargetPlayerViewModelLoadOwnershipIntegrationTest.exitAfterReadyStillWritesCurrentProgressMobilePlayerLifecyclePerformanceSourceTest(teardown source contract still holds)Test plan