Skip to content

fix(web): stop the setup wizard re-sending a subtitle provider edit after a failed save - #4739

Merged
Quick104 merged 7 commits into
mainfrom
fix/wizard-subtitles-failed-save-draft
Nov 21, 2026
Merged

Quick104 merged 7 commits into
mainfrom
fix/wizard-subtitles-failed-save-draft

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 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:

  • The next Continue sent the old draft with the newly loaded If-Match. If the failure was a 412 because another admin had saved first, that overwrote their configuration without showing it.
  • If Continue was pressed while that reload was still running, or after it failed, the row was skipped and the step was marked done with the edit unsaved and no message.

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

  • Reproduced live on a sandbox with the unfixed step. The wizard typed a SubDL key, another save of SubDL went in through the API, and the wizard's Continue got 412. The second Continue then sent the old draft (the provider's ETag advanced past the other save) and moved to Connect apps. Same result at desktop, iPad, and phone widths.
  • On the fixed web app against the same sandbox, the second Continue was disabled and sent nothing. The other save's ETag was unchanged, and Reload showed that saved configuration. Continue then moved on without another save. Same at all three widths, also checked under the en-XA pseudo-locale at phone width.
  • The new component test fails on main for the reported reason (the second Continue sends a second PUT) and passes here. It also covers a reload that fails and keeps the row locked.
  • Web gate: lint, format, build, budget check, and make test-web pass.

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

  • Pre-existing: the wizard's credential fields squeeze their label and hint into a narrow column at desktop and tablet widths (visible in the evidence). Handled separately, not in this PR.
  • User manual: unaffected (the manual doesn't describe this step's save flow).

Risks

None identified. The change is limited to the wizard's failure path. A save that succeeds behaves as before.

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

Rounds: 2, last reviewed 149e948; Gemini's retry pending on the current head

Member Round 1 Round 2
Sol (gpt-6.2-sol, xhigh) 8/10 8/10
Opus (claude-opus-5-5, high) 8.5/10 9/10
Gemini (gemini-4-neon, xhigh) failed (provider quota) retry pending

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

Member Round 1 Round 2
Sol better, 7/10 better, 8/10
Opus better, 6/10 better, 7.5/10
Gemini better, 6/10 better, 7/10

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

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; T3 Code delegated tasks (Codex, Claude, Antigravity) for plan and visual review
  • Model(s): claude-opus-5-5 (implementation and code review); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (plan and visual review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Code review at high, which tightened the test's failed-reload checks. In the plan round, Sol, Opus, and Gemini confirmed the reload-and-discard approach; Opus cut an early return from the submit handler. A simplify pass ran before each commit. See Council review.

🤖 Generated with Claude Code

Note

Stop setup wizard SubtitlesStep from re-sending a failed subtitle provider save

  • When a provider save fails in SubtitlesStep.tsx, the provider draft is now marked saveFailed and locked instead of being submitted again on the next continue.
  • Locked rows show a warning and a manual reload action. A successful reload replaces the draft with the saved editor state; a failed reload keeps the draft for another attempt.
  • Connection-test results are tied to both the credentials and the editor revision, so stale results from a prior draft are not shown.
  • The Continue button is disabled while any provider has saveFailed, and a provider-list error can now show alongside provider rows.
  • Adds regression tests in SubtitlesStep.test.tsx covering failed saves, failed and successful reloads, and draft discard.

Macroscope summarized 5070696.

Quick104 and others added 3 commits November 20, 2026 20:23
…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>
@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 34 minutes.

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: 01fdb770-8a8d-4fe7-98bd-4a9d5b168445
Commits

Reviewing files that changed from the base of the PR and between e7d467d and 5070696.

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-21T01:53:55.653972Z 5070696 New commits
🔒 Security Review ✅ Completed 2026-11-21T01:56:45.384242Z 5070696 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 the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@silo-triage silo-triage Bot added bug Something isn't working impact: usability Core flow broken or severely blocked javascript Pull requests that update javascript code priority: P1 Core-path bug; painful workaround — next after P0 triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. 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 (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

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 ❌

… 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

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 ❌

@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 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 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 (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

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 ❌

@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 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

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 ❌
⚠️ 5 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
  • Retain distributed firing claims through their own validity windows

@Quick104
Quick104 merged commit c75dd71 into main Nov 21, 2026
21 checks passed
@Quick104
Quick104 deleted the fix/wizard-subtitles-failed-save-draft branch November 21, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: usability Core flow broken or severely blocked javascript Pull requests that update javascript code priority: P1 Core-path bug; painful workaround — next after P0 size/L 200–499 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant