Repository navigation
fix(web): stop the setup wizard re-sending a subtitle provider edit after a failed save - #4739
Conversation
…t is reloaded After a provider save failed, the setup wizard's Subtitles step reloaded the editor and kept the draft, so the next Continue sent the old draft against the newer validator and could overwrite another admin's save. If that reload was still pending or failed, Continue skipped the row and finished the step with the edit unsaved. A failed save now keeps the draft on screen but locks the row, says the save wasn't confirmed, and offers "Reload saved configuration (discard draft)", as the admin Providers page does. Continue stays disabled until the row is reloaded; Skip still leaves without saving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…locked row From the visual review of the locked state: Reload replaces the disabled Test connection button in the same style, the reason shows as a warning status under the provider's own description, the failed save's toast closes on Reload, and the Reload label and warning wrap at phone width in longer languages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reload disappears once the saved configuration is back, so focus moves to the provider's switch instead of falling back to the page. 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 34 minutes. 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 (claude-opus-5-5, reviewed 8ef9102)
I found no correctness problems. A locked row can't be sent again: Continue is the form's only submit control and it is disabled. A reload always rebuilds the draft from the editor it loaded. Partial failures leave the saved rows unlocked and lock only the failed ones. Skip and the success path behave as they did before. There are two minor points inline: one about focus and one simplification.
AI disclosure: written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, as part of an automated adversarial review.
Reload resets the draft to the saved configuration, which can be another admin's, so a Test result from before no longer applies to it. 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:
|
… Reload focusable From the adversarial review of the failed-save lock: - A Test result is shown only while the editor revision it was taken against is still loaded, so a reload of another admin's save (or a test still running when the save failed) can't bring back an old result. - Reload stays focusable while it runs, so a keyboard user keeps their place if it fails, and the switch takes focus after a successful reload only when focus hasn't moved elsewhere. - The failed save's toast uses a fixed id, which Reload dismisses. 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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 8ef9102). Sol's review task couldn't post its own review, so this run posts its findings and how each was handled. Score: 8/10.
- S1 (medium): when one provider saves and another fails, the save refreshes the provider list. If that refresh fails, the step shows the list error in place of the rows, so the locked row and its Reload button are hidden while Continue stays disabled.
Not changed here. The error view's "Try again" brings the rows back with Reload, and Skip stays available. Before this PR the same error view also hid the rows, and Continue was enabled behind it, so it could finish the step with unsaved edits. This PR leaves the error view as it was. - S2 (low): a Test result taken with the saved key could come back after Reload, because the reloaded draft has the same blank-key signature, even though another admin may have changed the key. A Test still running when the save failed could do the same.
Fixed in 149e948. A Test result now shows only while the editor revision it was taken against is still loaded. - S3 (low): after a successful reload, focus moved to the provider's switch even if the admin had moved to another field in the meantime.
Fixed in 149e948. The switch takes focus only when focus fell back to the page.
🤖 Claude Code (claude-opus-5-5)
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 149e948, round 2)
Round 1: O1 (Reload dropped keyboard focus while loading) is resolved. Reload stays focusable, has its own key, and the switch takes focus after a successful reload. O2 (toast-id ref) is resolved by the fixed toast id.
I found no path that sends a draft against a validator it didn't capture, or that finishes the step with a locked edit. Continue is the form's only submit control and a locked row disables it. The list refetch after a partial save doesn't cancel reloads or post-save reads, and a successful read replaces the whole draft. A failed reload keeps the row locked and retryable, and Skip still works. One nit inline.
AI disclosure: written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code as an automated adversarial reviewer.
…ails to refresh A save that succeeds refreshes the provider list. If that refresh fails, the step now keeps showing the rows it already has, so a row locked by another provider's failed save keeps its Reload button; the list error view is only for a first load that failed. The locked row's warning is a live region, so a failed reload's message is announced. 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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 149e948, round 2). Sol's review task couldn't post its own review, so this run posts its findings and how each was handled. Score: 8/10.
- S1 (medium): still open at 149e948. After a partial save, a failed provider-list refresh hid the rows behind the list error, including the locked row's Reload. Fixed in 237bc28: a failed refresh now keeps the rows already loaded, and the list error view only replaces a first load that failed.
- S2, S3: resolved.
- S4 (low): a failed reload changed the row's warning text without announcing it. Fixed in 237bc28: the warning is a
role="status"live region.
🤖 Claude Code (claude-opus-5-5)
A failed refresh of the provider list now shows the existing error and its Try again button above the rows already loaded, rather than hiding the error. 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 reads provider status only and has no provider editor or setup wizard); Android N/A (same); Roku N/A (no subtitle provider settings)
When saving a subtitle provider fails on the setup wizard's Subtitles step, the wizard can either finish the step with the edit unsaved or send the old edit again over a newer saved configuration. Admins running first-run setup are affected, most visibly when a second admin saves the same provider while the wizard is open. This change locks the row after a failed save and requires a reload before the step can finish.
After a failed
PUT /api/v2/admin/subtitle-providers/{provider}, the step reloaded that provider's editor in the background, kept the typed draft, and re-enabled Continue:If-Match. If the failure was a 412 because another admin had saved first, that overwrote their configuration without showing it.docs/subtitles-api.md already says the setup provider card keeps the draft after a failed or uncertain save, and that another save requires an explicit reload that discards it. The admin Providers page follows that; the wizard did not.
Approach
The wizard now follows the same rule as the admin Providers page. After a failed save, the row keeps the typed draft but locks the switch and fields. It shows an amber "Save not confirmed" warning and puts "Reload saved configuration (discard draft)" where Test connection was. Continue stays disabled until the row is reloaded; Skip still leaves without saving. A reload shows the saved configuration, drops the draft, closes the failed save's toast, and returns focus to the provider's switch. If the reload itself fails, the row stays locked and Reload can be tried again.
All text reuses existing catalog keys from the admin Providers page, so there is no catalog change. Web only; no server or API change.
Not included: a provider switched on and back off still counts as changed, so it gets a PUT on Continue. That is separate from this failure path, and the test #4705 added relies on it.
Validation
make test-webpass.Evidence
Surface and build: setup wizard, Subtitles step, desktop, iPad, and phone widths, dark theme (the wizard has no light theme). The fixed web app ran from this branch's head against the same sandbox backend as the before captures.
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4739/
Follow-ups
Risks
None identified. The change is limited to the wizard's failure path. A save that succeeds behaves as before.
Checklist
Council review
Rounds: 2, last reviewed 149e948; Gemini's retry pending on the current head
Fixed: a Test result could reappear for another admin's credentials after Reload (now tied to the saved revision); Reload stays focusable while it runs and focus returns to the row only when it fell back to the page; a failed provider-list refresh keeps the rows it already has, so a locked row's Reload stays reachable; the locked row's warning is announced; a fixed toast id.
Visual review: 2 rounds
Fixed: Reload replaces the disabled Test connection in the same style, the failure shows as a warning status, the toast closes on Reload, the Reload label and warning wrap in longer languages, and focus returns to the row after a reload. Visual review answered: the toast position on phones, the disabled switch and input look, and 32 px button height come from shared components and are unchanged; the warning and button wording are existing catalog strings.
AI Disclosure
🤖 Generated with Claude Code
Note
Stop setup wizard SubtitlesStep from re-sending a failed subtitle provider save
saveFailedand locked instead of being submitted again on the next continue.saveFailed, and a provider-list error can now show alongside provider rows.Macroscope summarized 5070696.