Repository navigation
fix(playback): do not mark watched on premature EOF - #206
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
A mid-episode HTTP reset still reports end-of-stream. The player already detected that as premature (skip autoplay, show Connection lost) but then snapped currentTime to duration and latched hasReachedEndOfFile, so the completion policy treated the item as finished. Dismissing, Play Next, or the next progress tick overwrote the real resume point with "watched". Co-authored-by: Quick <[email protected]>
This was referenced Sep 23, 2026
2 tasks done
Contributor
|
Silo's pull request guidance changed today (#658). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Missing here: Before-and-after evidence that an item stopped by an early end of stream keeps its resume position instead of showing as watched, such as detail page screenshots. The rules are in Show visible changes, and the PR template shows the Evidence section layout. This PR is already a draft, so I've left it that way. Please fill in the Evidence section before marking it ready for review. Generated by Claude Code |
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
A mid-episode network drop can permanently wipe watch progress.
Aether/FFmpeg reports end-of-stream when the upstream HTTP connection resets, even if the file is nowhere near finished.
handleEndOfFilealready classified that as premature (it cancelled autoplay and showed "Connection lost"), but then still:currentTimetodurationhasReachedEndOfFilevideoEnded: true, which hides Keep Watching)PlayerNextUpCompletionPolicytreatshasReachedEndOfFileas a natural finish, so the next progress report, Play Next, or player dismiss sentposition = durationto the server. Continue Watching then treated the episode as completed and the real resume point was gone.Trigger: watch an episode well before the credits (for example 10 minutes into a 45-minute file). Drop the network so the demuxer hits EOS. Dismiss the player or tap Play Next. Reloading the item starts from the beginning (or skips it as watched) instead of 10:00.
The offline path already refused to mark completed on premature EOF; the online / completion-policy path did not.
Root cause
Premature EOF reused the natural-end latch (
hasReachedEndOfFile+currentTime = duration). Completion finalization had no way to tell a connection-reset EOS from a real finish.Fix
endedPrematurely.currentTimeto duration on premature EOF.endedPrematurelyis set.videoEnded: false) and resume from the drop point instead ofduration - 10.Validation
hasReachedEndOfFile == truedoes not finalize at duration, including when the Next Up UI is already dismissed.xcodebuildfrom this Linux environment; tests should run in CI on the PR.