Repository navigation
fix(player): preserve native seeks after completion - #475
Merged
Merged
Conversation
Deploying podnotes with
|
| Latest commit: |
c9e89fa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://182ef0f6.podnotes.pages.dev |
| Branch Preview URL: | https://fix-position-edges.podnotes.pages.dev |
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.
Summary
After an episode ended, Play could replace a native seek to 12 seconds with a restart at zero. Both Play paths now reconcile that movement first and treat the episode as paused. Untouched finished episodes still restart at zero, and unfinished synced progress still resumes.
Fixes #465
Refs #436
Verification
npm run lint,npm run format:check,npm run typecheck, andnpm run buildpassed on Node 22.23.2.npm run testpassed 2,570 tests.npm run test:toolingpassed 13 tests.npm run docs:buildbuilt 18 pages and resolved 112 legacy fragments.npm run test:e2epassed 190 tests on each fresh Linux vault, using Obsidian 1.14.4 and 1.13.7. After a test-only review correction, an independent verifier passed the final nine focused journeys on 1.14.4 and the full 190 on 1.13.7. Four reproduction cases failed on master and passed after the fix. The fixture isPosition Edgeswith a 60-second WAV. Screenshots useFixtures/Local Fixture.wav.npm run count:writesrecorded three completed writes before and after the same listening session, with no failures.npm run sizepassed at 99,051 gzip bytes, up 14 bytes, below 100,000.Verification report includes commands, runtime evidence, review decisions, and deviations. Reproduction scripts and logs include the mutation driver.
All 11 wrong alternatives fail named tests
Why #436 remains open
A real quit lost 2.209345 seconds. A synchronous localStorage tail survived restart, but saved progress has no revision to compare with it. Adopting the tail into the progress store can override newer sync that arrives after startup.
A safe follow-up could keep a clean recovery candidate outside the store, compare the last completed writer base, and yield to later sync. Another option is atomic file replacement with verified quit coordination. Both need persistence work beyond this small player fix. QuickAdd prior art was checked. The existing guarantee of no new
data.jsonwrite after quit remains intact.Release impact
No schema, settings, public API, or URI changes. No migration. Production code changes only in the player controller.
Docs at release
Update
docs/src/content/docs/podcasts.mdto explain that a seek after completion wins on Play, an untouched finished episode restarts at zero, and unfinished synced progress resumes. Published docs remain unchanged in this PR.Note
Fix
PlayerControllerto preserve native seeks after natural endPlayerController.playandPlayerController.resumenow record that position before selecting the episode or restartingnoteStoppedMovehelper converts an ended state to paused when it sees a changed stopped position, so post-end movement is treated as active playback rather than an ended restartresumenow returns early for disposed controllers and no longer selects the ended restart branch when a post-end native seek occursMacroscope summarized c9e89fa.