Repository navigation
fix(web): refresh the page after a retired session's stop lands - #4508
Conversation
When the server refuses a replan for a changed output, the player retires the session and sends its stop, then forgets the session. Going back from the error before that stop landed meant the unmount had no session to stop, so the host was never told when the retired stop settled and the page the viewer returned to kept the watch state it read before the stop. The player now keeps every stop it sends for a session it let go of until that stop settles. On unmount, each one still pending tells the host when it settles, separately from the unmount's own stop, so a slow stop does not hold up the others. Closes Silo-Server#4428
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 9 minutes. View limit details
|
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: This fixes the gap #4428 describes. When a refused output change retires the session and the viewer goes back before that stop lands, the page they return to now re-reads its watch state once the stop settles. The exit-stop path from #4423 is unchanged. How it was checked
Remaining items (no change needed)
Validated features: only #1252 C4 (Series, Web) could be reached, and it is recorded as Not run, so no passed case changes. The User manual: unaffected. This makes the web player refresh the page the way it already should; no setting, label, or documented behavior changes. Other clients: Apple, Android and Roku are not affected. The code path is the web player's session hook. Fit: 9/10 · Readiness: 9/10 — ready
🤖 Claude Code (claude-opus-5-5) |
Problem
Closes #4428
Related issue: N/A
Validation tasks: changes #1252 C4 (Not run)
Other clients: Apple N/A (web player only); Android N/A (web player only); Roku N/A (web player only)
If the web player stops a session because the server refused a quality or output change, and you go back before that stop reaches the server, the page you return to keeps showing old watch state until you reload it.
#4423 made the player tell the page to read its watch state again once the exit stop lands. That only covers the session the player still holds when it closes. When a replan for a changed output is refused, the player stops the session right away and forgets it. If you then choose Go Back on the error screen, the player has no session left to stop, so nobody is told when the earlier stop lands. That stop carries the last playback position, so in my test it was the only write of the episode's progress: the episode page came back with no progress bar and a plain Play button, while the server already had the position saved.
Approach
The player now keeps each stop it sends for a session it has let go of until that stop settles. When the player closes, every stop still pending tells the page once it settles, in the same way #4423 does for the exit stop. Each one tells the page on its own, so a slow stop never delays the refresh for another one. The exit stop path from #4423 is unchanged.
Validation
mainand passes with the fix.make test-web,pnpm run lint(no new warnings),pnpm run format:check,tsc -b,pnpm run build,pnpm run budget:check,make verify-local-paths,make verify-size-ratchet,make verify-bidi,make verify-case-collisions: all pass. Go checks were not run because no Go code changed.mainthe episode page made no catalog reads after the stop landed. With the fix it re-read the item, season and episode list within a few milliseconds of the stop and showed the progress bar. A normal exit with no refusal still re-reads once after its stop, as before.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4508/
Surface and build: web app episode page, desktop (1440 px) and phone (390 px), captured 4 s after the delayed stop landed. Before is
mainate8de1117e; after is this branch. Same local server, database and synthetic media for both.Risks
A player that closes while a retired session's stop is still pending re-reads the open page's playback queries once more when that stop lands. That is a few small catalog reads, and only after a refused output change or a session replacement whose stop has not landed yet.
Checklist
AI Disclosure
mainform, the fixture is shared, and the case was folded into the existing refused-output test. Round 2 found that two pending retired stops still shared one wait, so each now notifies on its own. Round 3 found no correctness issues. Dismissed: a start whose reply arrives after the player closes is not tracked, because that session never played and its stop writes no watch state.