Repository navigation
fix(web): keep seek interval controls editable after a failed capabilities refetch - #4526
Conversation
…ities refetch When a background refetch of the settings capabilities failed after the query had already answered, TanStack Query kept the last answer as data but set the query's error. useSeekPreferences reported that error, so the Playback settings page blanked and disabled the video and audiobook seek interval Selects and the legacy audiobook Import button, and the audiobook player's settings menu said the intervals failed to load. The hook now reports a capabilities or effective-settings error only when that query has no answer to show. A request that has never answered still counts as failed. Cached values stay editable because each write sets one key to the value the user picked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 2 minutes. View limit details
|
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. |
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:
|
|
Resolved: the requested mobile-web before-and-after captures have been added, with the surface and builds identified. Original requestPlease add before-and-after captures of the failed-refetch state on mobile web, with the surface and build identified. The Evidence section covers desktop only, but this shared seek-settings change also affects the Playback page at phone width; the contribution guide treats mobile web as a separate surface. |
Ignore a capabilities error only once the cached answer proves the shared seek keys are supported, so a failed check never reads as an old server. Keep a failed settings read as an error: after a successful save, a failed refetch leaves the cached interval out of date, and the Select would show it as current with no way to pick it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Related issue: N/A (found while reviewing #4519)
Validation tasks: none (no validation task covers seek intervals; the board itself couldn't be read, so the check searched issues labeled Validation)
Other clients: N/A (web query-cache handling; the fix is local to the web app)
The seek interval controls on the web Playback settings page could go blank and stop working mid-session. When a background refetch of the settings capabilities failed after it had already answered, TanStack Query kept the earlier answer but marked the query as errored.
useSeekPreferencespassed that error through, so the page:The cached answer still said the server supports the shared seek keys, and the seek values themselves kept loading. The audiobook player's settings menu reads the same error and said the profile's intervals failed to load. The refetch happens after the 30-minute stale window, on a remount or a network reconnect, and needs the capabilities request to fail twice (one retry).
Approach
useSeekPreferencesnow ignores a capabilities error once the cached answer shows the server supports the shared seek keys. Without such an answer, the error still counts: a request that never answered, or one whose last answer predates seek support, shows the existing discovery error rather than reading as an older server.A failed effective-settings read still counts as an error, as before. Saves only invalidate that query, so if the read after a save fails, the cached interval is out of date. Showing it as current would also block picking the old value back, since the Select sends nothing for the value it already shows.
The intro control on this page still requires a successful capabilities answer, as #4519 left it.
Validation
main(4102bca), after the second 503, all four seek Selects went blank and disabled and Import was disabled. With this change, the same steps keep every Select's value, the controls stay enabled, and Import stays enabled.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/playback-seek-failed-refetch/
Surface and build: web Settings → Playback, desktop and phone width, local sandboxes built from
main(4102bca desktop, d4a2117 phone) and from this PR's head 9890903.Risks
If the server is rolled back mid-session while capabilities keep failing, the page keeps offering the seek controls from the newer server's last answer until a refetch succeeds. A save would then fail with the existing error toast. #4519 accepts the same window for the player.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Keep seek interval controls editable after failed capabilities refetch
Fixes
useSeekPreferencesin seekPreferences.ts. The hook no longer returns a capabilities-query error when the retained capabilities data already confirms support for all seek keys. This keeps the seek interval controls editable after a failed capabilities refetch. The effective-settings query error is still returned, and the capabilities error is only returned when support is not confirmed.Macroscope summarized 9890903.