Repository navigation
fix(web): stop the setup wizard saving a subtitle key for a provider switched off - #4705
Conversation
…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>
|
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 1 minute. 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. |
Quick104
left a comment
There was a problem hiding this comment.
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 — 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
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
setup.completedset tofalseso the wizard opens, switch SubDL on, type a key, switch it off, press Continue. Before, the save carriedenabled: falseplus the typedapi_key, and SubDL then readhas_api_key: trueand showed "Connected · off" on the admin Providers page. After, the save carried onlyenabled: false, and SubDL still readhas_api_key: false.{"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.api_key, and passes here.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
Checklist
Council review
Background adversarial review: round 1 done on 4b3c01f.
Visual review: not run; nothing on screen changes.
Plan round (Sol, Opus, Gemini) before implementing: all three agreed with sending only
enabledfor 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
🤖 Generated with Claude Code
Note
Stop setup wizard saving subtitle credentials for disabled providers
In SubtitlesStep.tsx, the
providerBodypayload builder now returns early with onlyenabled: falsewhen the provider draft is disabled. Credentials typed before disabling a provider are omitted from the update request.enabled: false.ResizeObserverstub for environments lacking one.Macroscope summarized e532d2f.