Repository navigation
fix(web): keep a seek when a queued quality or track change runs - #4025
Conversation
…e it waited A quality or track change made while another replan is in flight queues with the position it was asked at. A seek made before the first replan answered never reached the queued request, so its stream jumped back to that position. The player now reports in-stream seeks to the session, which moves a queued quality, track or output change to the seek.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Review summaryReviewed head: 8c00a1e I found no defects in this change, so this review has no line comments and adds no commits. The bug is real on The fix holds up. Tests. The 370 player tests pass on this head. The new hook test fails on Seeks this change doesn't cover. Two seeks are still lost while a change is queued, and both behave the same way on Left for the maintainers
Validated features: not checked, because the validation board couldn't be read. A seek can reach this code only while a quality, track, or output change is queued, and nothing changes when no change is queued. User manual: unaffected. The manual doesn't describe how a seek interacts with a queued quality change. Fit: 9/10 · Readiness: 8/10 — conditional
Reviewed with read-only code-review passes and a cross-provider review (gpt-6.1-sol, one round). The cross-provider round's only finding was the pre-metadata direct-play seek, which is filed in #4069. 🤖 Claude Code (claude-opus-5-5) |
Problem
Closes #4010
Related issue: N/A
Validation tasks: changes #199 (in-player controls: seek/scrub); no recorded case results on #199 yet
In the web player, picking two qualities (or a quality and an audio track) in quick succession queues the second change behind the first. If the viewer then seeked before the first change answered, the first new stream started at the seek (since #3988), but the queued change still carried the position it was picked at. When it ran, playback jumped back there.
The queued request in
usePlaybackSessionkept itspositionSecondsfrom when it was queued, and nothing told it about a later seek. #3988's remembered seek inVideoPlayeronly covers the first replacement stream.Approach
VideoPlayernow reports each seek it makes inside the stream it already has to the session (onSeek→reportSeek). When a quality, track or output change is queued, the session moves it to that position, so the queued request asks the server for a stream at the seek. This works the same way as the existing fold of a reanchor seek into a queued output change. A queued failure recovery or reanchor keeps its own position, and with nothing queued the report does nothing.Web only. No API, server, or client app changes.
Validation
mainin headless Chromium on the production bundle, with a synthetic 5-minute 1080p file: play at 120 s, pick 720p, pick 480p while the first replan is held for 4 s, click the seek bar at 30 s. The 720p stream started at 30 s; the 480p stream then jumped back to 123 s. On this branch the queued request carries 29.9 s and the 480p stream continues from about 30 s.main.pnpm run lint,pnpm run format:check,pnpm run build,pnpm run budget:check,tsc,make test-web,make verify-local-paths,make verify-bidi,make verify-size-ratchetandmake verify-case-collisionspass. No Go code changed, so the Go half of the gate was not run.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4025/
Surface and build: web app player at 1440px, the same steps on a local build of
mainand of this branch. Position log excerpt (seek bar position in seconds):Phone width is unaffected: the change is in the stream's start position, not its layout.
Risks
None identified. A seek outside the seekable window on a plan that cannot seek anywhere, made while a quality or track change is queued, is still refused and the queued change resumes where it was picked. That is the same on
mainand outside this issue, which covers seek-anywhere plans.Checklist
AI Disclosure
Note
Preserve in-stream seeks when a queued quality or track change runs
VideoPlayernow reports the position to the playback session via a new callback prop; it does not report on the reanchor path.usePlaybackSessionuses the reported position to update the pending replan options, but only for pending quality, track, or output changes with a finite nonnegative position. A queued change that runs later now seeks to the user's position instead of the old one.Macroscope summarized 8c00a1e.