Repository navigation
fix(vault): don't collapse +30s skip to 0 when duration is unknown - #573
Conversation
VaultPlayerViewModel.onSkipForward clamped the skip target against exo.duration.coerceAtLeast(0), which collapses to 0 while duration is still C.TIME_UNSET (negative) — seeking to the very start of the book instead of leaving the skip a plain forward nudge. Extracted the target computation into skipForwardTarget() so it's unit-testable without a real ExoPlayer. Closes #564.
|
Pipeline is at capacity (7/5 active runs) — skipping this QA run. Re-apply status:needs-qa once activity settles, or re-trigger manually via workflow_dispatch. |
QA verification — PR #573 vs issue #564Issue type: bug report (no acceptance checklist) — checklist is "repro no longer reproduces, and a regression test proves it."
Tests run:
Regressions / related areas: AGENTS.md conventions:
Note on the PR's "overlapping work" section: verified independently — PR #537 (issue #530's batch, contained this same L1 fix) was open when #573 was created and was closed ~2 minutes later, consistent with the PR description's account. Not a QA blocker. No gaps found. QA verdict: PASS |
Principal review — verdict:
|
…IME_UNSET bug Merges origin/dev through PR #573 — resolves a second modify/delete conflict on VaultPlayerViewModel.kt (kept deleted, per this branch), which #573 had touched to fix issue #564 (skip-forward collapsed to the start of the book while duration was still C.TIME_UNSET). That fix's own logic (skipForwardTarget()) duplicated an existing, already- tested utility this branch's PlayerViewModel just never used: SeekClamp.clamp (feature:player/service), already relied on by LibraryViewModel.seekBy and ReaderViewModel.seekByAudiobook for exactly this C.TIME_UNSET case. Ported #573's fix onto PlayerViewModel.skipForward()/skipBack() via SeekClamp instead of reintroducing a second, vault-only copy of the same clamp logic — this fixes the identical bug for the shared audiobook player screen too (both real-file and vault audio), not just the vault-specific path #573 patched. Deleted the now-orphaned VaultPlayerSkipForwardTargetTest.kt; SeekClampTest already covers the same TIME_UNSET boundary case. feature:player, feature:vault test suites green; app compiles both flavors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
VaultPlayerViewModel.onSkipForwardclamped the skip target againstexo.duration.coerceAtLeast(0), which collapses to 0 while duration isstill
C.TIME_UNSET(negative) — seeking to the very start of the bookinstead of leaving the skip a plain forward nudge.
skipForwardTarget()helper(unit-testable without a real ExoPlayer) and switched
onSkipForwardtouse it, guarding
durationMs > 0before clamping.Tests
VaultPlayerSkipForwardTargetTestcovers: unknown duration (full skipapplied), known duration (clamped), and negative position (never goes
below 0).
locally, saw 1/3 tests red) before restoring the fix, per
AGENTS.md's"prove a new test can fail" rule.
./gradlew :feature:vault:testDebugUnitTestpasses in full locally.Note on overlapping work
This duplicates the L1 commit already present on the still-open
PR #537 (issue #530's 8-finding batch, currently labeled
status:needs-infoafter exhausting its turn budget partway through L1-L5).Issue #564 states PR #537 is "now-closed," but as of this writing it is not
— it's open, stuck on human triage, and its diff already contains this
exact fix plus L2-L5. Since #564 was filed specifically to split L1 out into
its own small PR (per the human-facing recommendation logged in #537's
comments), this PR implements that split using the same approach #537
already validated. Once this merges, whoever resumes #537 should drop its
now-redundant L1 commit.
No sensitive paths touched (
feature/vault/**isn't onagent-policy.yml'ssensitive_pathslist), no security/release-blocker signal in the issue.Closes #564.