Skip to content

fix(web): stop the setup wizard saving a subtitle key for a provider switched off - #4705

Merged
Quick104 merged 2 commits into
mainfrom
fix/wizard-subtitles-hidden-credentials
Nov 21, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/wizard-subtitles-hidden-credentials

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Other clients: Apple N/A (the app has no subtitle provider setup); Android N/A (same); Roku N/A (same)

On the setup wizard's Subtitles step, a key typed for a provider that was then switched off was saved anyway. The step hides a provider's credential fields while its switch is off, but Continue still sent whatever had been typed into them, and the server stores any non-blank credential whether or not the provider is on. The admin finished setup with a key saved on a disabled provider ("Connected · off" on the admin Providers page) that they never saw being saved.

To reproduce on main: switch SubDL on, type an API key, switch it off, press Continue. The request carries {"enabled": false, "api_key": "<typed key>"}. OpenSubtitles sends its username and password the same way.

Approach

A provider switched off now sends only {"enabled": false}. A blank or omitted credential already means "keep what is stored", so credentials saved earlier stay as they are. What was typed stays in the step's draft, so switching the provider back on before Continue shows the same values again and sends them.

#4696 handles this kind of problem on settings pages by keeping a hidden field on screen while it holds an unsaved edit. That doesn't fit here: this step's switch and credentials go out in one request, and the step has no way to save credentials for a provider that is off. Admin → Settings → Providers still lets an admin save a key for a disabled provider, with the fields in view.

Validation

  • Reproduced on a Silo dev deployment, before (main at 1169342) and after (this branch): with setup.completed set to false so the wizard opens, switch SubDL on, type a key, switch it off, press Continue. Before, the save carried enabled: false plus the typed api_key, and SubDL then read has_api_key: true and showed "Connected · off" on the admin Providers page. After, the save carried only enabled: false, and SubDL still read has_api_key: false.
  • On the same deployment, a provider that already had a key kept it after a save of {"enabled": false}, so switching off a configured provider in the wizard doesn't drop its key. Switching a provider back on after typing a key and switching it off still saves that key.
  • A new page test drives the reported sequence. It fails on main because the save carries api_key, and passes here.
  • Web lint (0 errors), Prettier, build, and the bundle budget pass. The full web suite run locally on Node 26 has 29 failures in four files (request deadline, auth core, and two player auth tests). The same tests fail the same way on main in that environment, and none of them involves this change.

Evidence

Surface and build: web setup wizard, Subtitles step; the dev deployment ran 4b3c01f. Nothing on screen changes; what changes is the request Continue sends and what the server stores. The evidence page has the request bodies, the stored provider state, and screenshots from both runs. The head commit after that run (e532d2f) changes only a test comment.

Evidence: https://evidence.siloserver.org/r/silo-server/wizard-subtitles-hidden-credentials/

Risks

None identified.

Follow-ups

  • Found while planning this fix, and already on main: after a provider save fails, Continue can mark the step done with the edit unsaved, or send the old draft again over a newer saved state. That is being fixed separately.
  • User manual: unaffected. It only tells new admins they can skip the subtitle services.

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.

Council review

Background adversarial review: round 1 done on 4b3c01f.

Member Round 1
Sol (gpt-6.2-sol, xhigh) 9/10, no findings
Opus (claude-opus-5-5, high) 9/10, no findings
Gemini (gemini-4-neon, xhigh) 9/10, G1 (low): the test's comment on the providers mock described the wrong failure; fixed in e532d2f

Visual review: not run; nothing on screen changes.

Plan round (Sol, Opus, Gemini) before implementing: all three agreed with sending only enabled for a provider that is off. The test asserts the exact body (from Gemini). Left out: skipping the save when a provider ends where it started, which happens on main too. Code review at xhigh effort: the test's provider list mock now returns one stable object, as React Query does, so an extra render can't stall the step's editor load.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code (implementation, live checks, code review subagents); T3 Code delegated reviews through Codex CLI and Antigravity
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (plan and adversarial reviews); claude-sonnet-5-5 (one code-review finder and the validation check)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: a three-model plan round and a multi-agent code review at xhigh effort ran before opening, and a simplify pass ran on the code; a background adversarial review ran on the opened PR. See Council review.

🤖 Generated with Claude Code

Note

Stop setup wizard saving subtitle credentials for disabled providers

In SubtitlesStep.tsx, the providerBody payload builder now returns early with only enabled: false when the provider draft is disabled. Credentials typed before disabling a provider are omitted from the update request.

  • Adds a test in SubtitlesStep.test.tsx that enables SubDL, enters an API key, then disables the provider, and asserts the mutation receives only enabled: false.
  • Test fixtures add wizard, provider-query, and mutation mocks, plus a no-op ResizeObserver stub for environments lacking one.

Macroscope summarized e532d2f.

…switched off

The Subtitles step hides a provider's credential fields while its switch is
off, but Continue still sent whatever had been typed into them. The server
stores any non-blank credential whatever `enabled` says, so a key typed and
then switched away was saved on a disabled provider the admin could no
longer see.

A provider switched off now sends only `{ enabled: false }`. Blank
credentials already mean "keep the stored value", so anything saved earlier
stays; typed values stay in the draft and come back if the provider is
switched on again before Continue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 57d5e182-d3eb-4b31-9b07-d784bec5194b
Commits

Reviewing files that changed from the base of the PR and between 0d649bd and e532d2f.

Files selected for processing: 2

  • web/src/pages/setup-wizard/steps/SubtitlesStep.test.tsx
  • web/src/pages/setup-wizard/steps/SubtitlesStep.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 21, 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 21, 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-21T00:23:09.541569Z 4b3c01f PR opened
🔒 Security Review ✅ Completed 2026-11-21T00:44:09.842525Z e532d2f New commits
ℹ️ 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 priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026

@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 (gemini-4-neon, reviewed 4b3c01f)

One low-severity finding inline on the comment explaining providersQuery in SubtitlesStep.test.tsx. The production change in providerBody matches the render condition, all callers, the server's INSERT and UPDATE handling of omitted credentials, the generated TypeScript request types, and docs/subtitles-api.md.

AI-assisted review using gemini-4-neon (Antigravity harness).

…p.test

A new `data` object re-runs the step's load effect, whose cleanup cancels
an in-flight editor read and leaves the row loading. The old comment said
it would restart the load instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 21, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@Quick104
Quick104 merged commit 4ed842d into main Nov 21, 2026
20 checks passed
@Quick104
Quick104 deleted the fix/wizard-subtitles-hidden-credentials branch November 21, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant