Skip to content

fix(web): keep settings capabilities known after a failed refetch - #4519

Merged
Quick104 merged 2 commits into
mainfrom
fix/web-capabilities-known-last-good
Nov 18, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/web-capabilities-known-last-good

Conversation

@Quick104

@Quick104 Quick104 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 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.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/web-capabilities-known/

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.

🤖 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.

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>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 18, 2026
@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T20:32:19.705890Z e48b29b PR opened
🔒 Security Review ✅ Completed 2026-11-18T20:34:23.346262Z e48b29b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added bug Something isn't working javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

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.

Changes: Capability handling

Layer / File(s) Summary
Capability availability gates
web/src/pages/settings/PlaybackSettings.tsx, web/src/playback/WatchPlaybackChrome.tsx
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.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

  • 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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (gpt-6.2-sol, reviewed e48b29b)

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.

AI disclosure: Codex in T3 Code, gpt-6.2-sol.

// failed background refetch keeps the last good answer as `data` under an
// error status; that answer still counts, or the settings read below would
// drop every revision-gated key mid-session.
const capabilitiesKnown = settingsCapabilities.data !== undefined;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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.

🤖 Claude Code (claude-opus-5-5)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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>
@Quick104
Quick104 merged commit d4a2117 into main Nov 18, 2026
22 checks passed
@Quick104
Quick104 deleted the fix/web-capabilities-known-last-good branch November 18, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant