Repository navigation
fix(tv): re-read the episode rail after the player's stop lands - #954
Conversation
Back from the player, the series page (and an episode page's rail) read seasons and episodes before the player's detached stop sent its final progress, and never read them again. The rail could keep the episode's pre-stop progress with no watched badge, and the season's watched count stayed stale until the next resume. When refreshOnReturn consumes a playback return (the series return, the Next Up episode's, or the page's own), quietRefresh now waits for the stop, lets the immediate episode load finish, and reads seasons and the selected season's episodes again with fresh reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 49 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:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20be046a37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A season change during the wait cancels the joined load and starts a cache-backed one. The fresh read now waits for that one too, so its failure cannot undo the change. A newer playback return replaces the pending read instead of stacking another. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
Problem
On Android TV, coming back to a series page from the player could leave the episode rail out of date. The episode just played kept its old progress bar and had no watched badge, and the season's watched count stayed stale until the page resumed again. An episode page's rail had the same problem.
The player sends its final progress and stops the session in a background job after it closes. The detail page refreshes as soon as it resumes. #845 made the page's own detail read wait for that stop, but only when the page itself was the title played. A series page never qualified, because the player records its return under the episode, not the series. So the season list and the episode rail were read before the stop landed, and nothing read them again afterwards.
Found in review of #847. The defect itself is on main, from #845.
Solution
refreshOnReturnnow tellsquietRefreshwhen it consumed a playback return for this page: the series return, the Next Up episode's, or the page's own. In that casequietRefreshstarts a job that waits for the stop, waits for the episode load already running to finish, and then reads the season list and the selected season's episodes again with fresh reads. The refresh at resume still runs first, so the rail picks up the local progress overlay right away.The job waits for any running episode load before its fresh read, including one a season change starts during the wait, because a fresh read has no cache fallback. If it replaced the cache-backed load for a season the return or the viewer had just selected, and then failed (offline, or a flaky network), the season would snap back. A newer playback return replaces a read still waiting.
The rail refresh moved into
refreshEpisodeRails. The code inside is unchanged.Validation
seriesReturnRereadsEpisodesAndSeasonsAfterThePlayerStopLandsinTvNextUpSelectionHandoffTest. It opens a series page, records the player's returns, keeps the stop pending until the page's reads have answered, then lands the stop with episode 1 watched. It asserts that the rail shows episode 1 watched and that Season 1 counts as watched. It fails on the base (d1c36e7): it times out because nothing reads again after the stop. It passes with the fix.:androidTvApp:testDebugUnitTest(1,403 tests),:androidTvApp:lintDebug, and:androidTvApp:assembleDebugpass.Validation tasks: none
Evidence: https://evidence.siloserver.org/r/silo-android/tv-series-refresh-after-stop/
Risks
Follow-ups
loadBoxSet) and the Next Up episode's playback detail (refreshNextUpPlaybackDetail) still read before the stop. The Next Up target and its resume label come from the rail rows, which this PR re-reads.PlaybackSessionLifecycleannounce when a stop lands, so every screen that reads user data can refresh once, instead of each page waiting on its own.Other clients: Apple N/A (the player awaits
ItemDetailCache.refreshAfterPlaybackafter its final progress write); Roku N/A (the detail screen reads again after a delay to cover a late stop); Web Silo-Server/silo-server#4374Adversarial review
high, three finders, a validation check, and a verifier): one finder showed that the fresh read could cancel the cache-backed load for a season the return had just selected and, offline, lose the return. The job now waits for that load first. The verifier found no remaining wrong final state. Bot review (Codex) then showed the same failure for a season the viewer picks during the wait; the job now waits for that load too (b87a0dc). Kody asked for an ownership generation; a newer return now replaces the pending read, and the per-request generations already own what gets published.AI disclosure
🤖 Generated with Claude Code