You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): keep settings capabilities known after a failed refetch - #4519
Related issue: N/A (found while reviewing #4503)
Validation tasks: none blocked or regressed; touches the intro-skip path of #1149 C1, which behaves the same unless the capabilities request fails after it has already answered
Other clients: N/A (web query-cache handling; the fix is local to the web app)
Mid-session, the web player could stop applying a viewer's newer playback settings. The player reads the settings capabilities to decide which setting keys the server knows. When a background refetch of that request failed after it had already answered, TanStack Query kept the earlier answer but marked the query as errored. The player only checked whether the query had succeeded, so it treated the server's capabilities as unknown and re-read its settings without every key that newer server revisions add.
In that state:
intro skip fell back to the legacy playback.auto_skip_intro boolean, so a profile set to never could get the skip prompt;
the buffering quality mode and the cellular quality pair stopped applying;
marker confidence and source stopped showing on the skip prompt.
The refetch happens after the 30-minute stale window, on a new player mount or a network reconnect, and needs the capabilities request to fail twice (one retry). #4503 puts playback.next_up_enabled behind the same check, so without this fix a viewer who turned Next Up off would get it back in that state.
Approach
Capabilities now count as known once any answer has arrived (data !== undefined), not only while the last request succeeded. A capabilities request that has never answered still counts as unknown. The player still holds the intro-skip decision and keeps the remembered buffering mode until the first answer, as before.
The intro control on the Playback settings page uses the same success check, but it stays as it is. That page writes the setting, and its legacy switch could overwrite a newer never choice, so only a successful answer should enable it there.
Follow-up: the Interface settings page shows its load error after the same failed refetch, on main too. A separate fix handles it.
Validation
Live reproduction on a local sandbox, scripted in a browser: start a movie, move the clock past the 30-minute stale window, make the capabilities request return 503, then trigger a network reconnect. On main (2f5a14b), after the second 503, the player re-read its settings with only playback.auto_skip_intro, playback.auto_skip_recap, playback.auto_play_next_preview, playback.preferred_quality, playback.max_bitrate_kbps. With this change, the same steps cause no re-read, and the player keeps the read that includes the intro mode, buffering mode, cellular pair, and marker provenance keys. The only console errors were the injected 503s.
Web lint, format check, build, bundle budget, and the full web test suite pass. The live run and the gate ran on the first commit, which also changed the settings page; the player code is the same in the current head.
No test added: the check sits inline in the player host, and testing it would mean rendering the whole host with mocks. The live run above is the proof.
Surface and build: web player, desktop, local sandbox built from main at 2f5a14b and then from this branch. Nothing on screen changes; the evidence page records the settings requests before and after.
Risks
If the server is rolled back mid-session while the capabilities request is failing, the player keeps the newer server's last answer until a refetch succeeds. An older server can then reject the player's settings read for a key it doesn't define, and the player keeps the settings values it already loaded until then. The 30-minute stale window already allows this when refetches succeed.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code, GitHub CLI, Playwright
Model(s): claude-opus-5-5
Involvement: Fully AI-generated; human review pending
Adversarial review: plan round skipped (two-line change at the root cause, nothing added). Background adversarial review by gpt-6.2-sol (Codex) on e48b29b: F1 (rollback with failing discovery) answered in its thread and noted under Risks; F2 (Interface settings, also on main) moved to a separate fix. A CodeRabbit finding on the settings page led to dropping that page's change.
Fix settings capabilities check to use data presence, not query status
Changes the capabilities-known check in the playback host component from query success status to whether the query has data. This keeps revision-gated settings working when a background refetch fails, since retained data still counts as a valid answer. Before any data arrives, capabilities remain unknown. Change is in WatchPlaybackChrome.tsx.
The player's capabilities gate read the query's isSuccess, so a failed
background refetch (status error, last good data kept) counted as
"capabilities unknown". The player then re-keyed its effective-settings
read without every revision-gated key: intro skip fell back to the legacy
boolean, and the buffering mode, cellular quality pair, and marker
provenance settings stopped applying mid-session.
Count capabilities as known once any answer has arrived, in the player and
in the Playback settings intro control, which used the same check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playback settings and playback chrome now treat capability data as known when data is present. Without data, capability-dependent controls remain unknown. Retained data continues to determine behavior after a failed refetch.
The settings page selects the legacy intro-skip switch when capability data is present and does not support intro-skip mode. Playback chrome treats capabilities as known whenever data exists, including during a failed refetch.
Silo-Server/silo-server#4503: Adds a Show Next Up Off option that uses the same capabilities contract to determine when settings are loaded and supported.
Suggested reviewers:rhainland, blurbery
Merge Risk: Low · previous review e48b2
Playback and settings now keep the last known capabilities when a background refresh fails, which fixes the reported re-read problem. In a rare case, a server upgrade combined with a failed refresh could let the legacy intro-skip switch overwrite a newer setting. This is a small, bounded risk that the owner should be aware of.
Security architecture risk: Minimal · up to e48b2
The fix preserves previously loaded playback capabilities when a refresh fails. No introduced security, ownership, or security-relevant failure-containment risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: capabilities data stays known after a failed background refetch. It matches the raw summary, which says the player and Playback settings treat capabilities as known on…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description states the problem (player stops applying newer playback settings after a failed capabilities refetch), the approach (treat capabilities as known once data arrives, in the player and t…
Full details: Title check
Explanation
The title names the main change: capabilities data stays known after a failed background refetch. It matches the raw summary, which says the player and Playback settings treat capabilities as known once data exists. The conventional-commit prefix and the 65-character length are acceptable.
Full details: Description check
Explanation
The description states the problem (player stops applying newer playback settings after a failed capabilities refetch), the approach (treat capabilities as known once data arrives, in the player and the Playback settings intro control), the validation (live sandbox reproduction, lint/build/test runs), the risks, and the related follow-up. It is specific to the changeset and is not off-topic, so the check passes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
F2 · Low · Interface Settings hides controls after a capabilities refetch fails. This also occurs on the base commit. In web/src/contexts/UICustomizationProvider.tsx:34, a failed capabilities refetch marks customization unavailable even with a cached response that confirms support and a successful settings read. InterfaceSettings.tsx then replaces the poster controls with an error and hides the menu editor. I reproduced the state with TanStack Query 5.90.20 after two simulated 503 responses. Treat missing capability data as discovery failure and keep the separate check for a failed settings read.
The reason will be displayed to describe this comment to others. Learn more.
F1 · Low · Unsupported keys can stop the whole playback settings read after a rollback. Keep the tab open on revision 29, roll the server back to revision 23, and reconnect after the capabilities query is stale. If discovery returns 503 twice while the older server answers the effective settings request, the cached revision keeps playback.show_marker_confidence and playback.show_marker_source in the batch. Revision 23 rejects the batch with a 422 on query.keys, so supported values such as playback.max_bitrate_kbps cannot refresh. The base commit requests a reduced batch after discovery fails. I verified the request difference with TanStack Query 5.90.20 and the historical revision 23 manifest in a local simulation. Keep the cached capabilities for transient failures and recover from a query.keys rejection by retrying the baseline settings separately and refreshing discovery.
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I am leaving this as is and recording it under Risks in the PR body. The trigger needs a mid-session server rollback while discovery is failing and the settings endpoint is answering. In that state, the effective-settings query keeps its key, so TanStack keeps the values the player already loaded instead of clearing them. Only the refresh fails until discovery recovers and re-keys the read. Inside the 30-minute stale window, main already has the same exposure with a successful but stale answer. A query.keys fallback retry would add a second read path for a case none of the reports reach. Leaving this thread open for the maintainer.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 30e259b4-d4b5-4c4f-94ca-d9fa9a29a6de
Commits
Reviewing files that changed from the base of the PR and between 939cf24 and e48b29b.
Files selected for processing: 2
web/src/pages/settings/PlaybackSettings.tsx
web/src/playback/WatchPlaybackChrome.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
The Playback settings page writes the intro setting, and its legacy switch
can overwrite a newer `never` choice. Keep its existing rule there: only a
successful capabilities answer enables the legacy switch. The player, which
only reads, keeps the last good answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingjavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/S0–49 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A (found while reviewing #4503)
Validation tasks: none blocked or regressed; touches the intro-skip path of #1149 C1, which behaves the same unless the capabilities request fails after it has already answered
Other clients: N/A (web query-cache handling; the fix is local to the web app)
Mid-session, the web player could stop applying a viewer's newer playback settings. The player reads the settings capabilities to decide which setting keys the server knows. When a background refetch of that request failed after it had already answered, TanStack Query kept the earlier answer but marked the query as errored. The player only checked whether the query had succeeded, so it treated the server's capabilities as unknown and re-read its settings without every key that newer server revisions add.
In that state:
playback.auto_skip_introboolean, so a profile set tonevercould get the skip prompt;The refetch happens after the 30-minute stale window, on a new player mount or a network reconnect, and needs the capabilities request to fail twice (one retry). #4503 puts
playback.next_up_enabledbehind the same check, so without this fix a viewer who turned Next Up off would get it back in that state.Approach
Capabilities now count as known once any answer has arrived (
data !== undefined), not only while the last request succeeded. A capabilities request that has never answered still counts as unknown. The player still holds the intro-skip decision and keeps the remembered buffering mode until the first answer, as before.The intro control on the Playback settings page uses the same success check, but it stays as it is. That page writes the setting, and its legacy switch could overwrite a newer
neverchoice, so only a successful answer should enable it there.Follow-up: the Interface settings page shows its load error after the same failed refetch, on
maintoo. A separate fix handles it.Validation
main(2f5a14b), after the second 503, the player re-read its settings with onlyplayback.auto_skip_intro, playback.auto_skip_recap, playback.auto_play_next_preview, playback.preferred_quality, playback.max_bitrate_kbps. With this change, the same steps cause no re-read, and the player keeps the read that includes the intro mode, buffering mode, cellular pair, and marker provenance keys. The only console errors were the injected 503s.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/web-capabilities-known/
Surface and build: web player, desktop, local sandbox built from
mainat 2f5a14b and then from this branch. Nothing on screen changes; the evidence page records the settings requests before and after.Risks
If the server is rolled back mid-session while the capabilities request is failing, the player keeps the newer server's last answer until a refetch succeeds. An older server can then reject the player's settings read for a key it doesn't define, and the player keeps the settings values it already loaded until then. The 30-minute stale window already allows this when refetches succeed.
Checklist
AI Disclosure
main) moved to a separate fix. A CodeRabbit finding on the settings page led to dropping that page's change.🤖 Generated with Claude Code
Note
Fix settings capabilities check to use data presence, not query status
Changes the capabilities-known check in the playback host component from query success status to whether the query has data. This keeps revision-gated settings working when a background refetch fails, since retained data still counts as a valid answer. Before any data arrives, capabilities remain unknown. Change is in WatchPlaybackChrome.tsx.
Macroscope summarized 41f9e3b.