Skip to content

fix(web): let a settings page save again after settings change elsewhere - #4684

Open
Quick104 wants to merge 28 commits into
mainfrom
fix/settings-form-412-conflict
Open

Quick104 wants to merge 28 commits into
mainfrom
fix/settings-form-412-conflict

Conversation

@Quick104

@Quick104 Quick104 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Other clients: N/A (no client-visible change outside the web app: the Apple, Android, and Roku apps don't edit server settings)

When server settings changed while an admin had unsaved edits on a web settings page, the page could no longer save. Every Save was refused with 412, the toast showed the server's English problem text, and the only way out was Discard, which threw away every edit. Settings change underneath a page when another admin or browser tab saves, or when the server restarts with a SILO_* variable whose value differs from the stored one. This change keeps the server's refusal and gives the admin a way forward: a translated message with a Reload button that brings in the current settings, keeps the edits when it safely can, and lets the next Save through.

The settings form guards each save with the ETag of the snapshot it read at the first edit. Only a successful save, Discard, a profile switch, or reverting every edit replaced that baseline, so after a refusal each later Save sent the same stale If-Match and was refused again.

Approach

On a 412 from PUT /api/v2/admin/settings, useSettingsForm keeps every draft and shows a toast ("Settings changed elsewhere") with a Reload button; the toast stays until the admin reloads, discards, or reverts every edit. Reload reads the settings, then the secret status, and keeps the page's edits only if nothing on the page changed and it can vouch for every edit:

  • An edit can be kept when its setting still shows the value it showed when that edit began, so the next save can't overwrite a change this admin never saw.
  • Every other setting the page shows must still have the value it had when the edits began (or after the last Reload or save that kept them), and the page's passwords and keys must be set or unset as they were then. That covers settings a page shows without editing them, and a change a background read had already put on screen.
  • Saved passwords and keys never appear in the settings snapshot, so the form can't tell whether another admin changed one. An edit to a secret that was set when the edit began, or is set now, can't be kept, and neither can a Redis database number while a Redis URL is saved. Edits to secrets that were never set, and to unset settings the snapshot leaves out, can.
  • If anything on the page changed, or any edit can't be kept, Reload undoes all of them. Edits on a page often go together (a server address and its password, a search provider and its connection), so keeping some could save a combination nobody entered. A change on another page keeps every edit.

When Reload keeps the edits, the form adopts the new snapshot as its save baseline; when it undoes them, the fields show the current settings again. A reload whose secret-status read fails keeps every edit and offers Reload again, since without the status an unset setting and a secret look alike. A reload that settles after Discard, a profile switch, or a save started meanwhile (even one already refused) changes nothing, and a save that settles after Discard no longer sets a baseline for edits that are gone. The setup wizard steps use the same form, so they get the same behavior; their own error toast now skips that 412 so it isn't shown twice. The five admin surfaces that call useUpdateServerSettings directly keep their current behavior (see Follow-ups).

Two pages kept their own state next to the form's drafts and needed it to follow a Reload that undoes them: the AI page now shows a connection test result only while the tile holds the values it tested, and the setup wizard's Features step stages its marker-sharing default again.

Two shared web changes came out of the visual review, because the new toast's button has to stay usable next to the floating save bar. While a SaveBar shows, it publishes the room it takes at the bottom of the screen and the toaster keeps every toast above it; before, any toast covered Discard and Save at tablet and phone widths. Toast action buttons now get the app's focus ring, a hover state, and a 44px height on touch screens.

The strings are in Silo-Server/silo-translations#120, Silo-Server/silo-translations#126, Silo-Server/silo-translations#130 and Silo-Server/silo-translations#133 (the toast text followed the reload rule as review tightened it). Main's translation pin already includes all four, so this branch adds no locale changes.

Validation

  • Reproduced on a dev sandbox built from main (66b836f8): with an unsaved edit on Settings → General, another admin's save made both following Saves answer 412 with the same If-Match.
  • On a sandbox build of 45dd421a (the head since then only changes the AI page's test results), Settings → General:
    • Another admin changed the server log level, which is on the Logging page. Both Saves were refused with the old validator; Reload kept the Server name and Login subtitle edits; the next Save answered 200 with the new validator. A page reload showed both edits stored and the other admin's log level unchanged.
    • Another admin changed Login subtitle on the same page. Reload undid the Server name edit: the field showed the stored name, Login subtitle showed the other admin's value, and the save bar went away.
  • Captures from that build at 1440, 820, and 390px, keyboard focus and hover on Reload, Discard, and the en-XA pseudo-locale (no untranslated text).
  • Web tests (useSettingsForm.reload.test.ts) run the real form against a fake settings server with ETags. They cover a reload that keeps every edit and what the next save writes; reloads that undo every edit (a saved password entered with a new server address, a change to a setting on the page, a change to a setting the page shows without managing it); a failed secret-status read that keeps the edits, then a retry that still finds the change the failed read brought in; and a save started while a reload is reading. All three tests fail on main (the refused save offers no Reload), and each review fix's test failed on the commit before it.
  • Web lint, format check, typecheck, and the related web tests pass locally under Node 24; CI passes on 4186d3c.
  • Maintainer review (head 745c8f9, main merged in): on a sandbox build of 361d49bb, a change on another page let Reload keep the edit and the next Save answer 200, and a change on the same page undid it. With a playback bar's clearance set, the toast sat above the settings save bar. The review's fixes add RedisGroup tests that fail without them. Review evidence: https://evidence.siloserver.org/r/silo-server/pr-4684-review/

Evidence: https://evidence.siloserver.org/r/silo-server/settings-412-conflict/

Risks

  • Every toast now sits higher while a settings page has unsaved changes, and every toast action button looks slightly different (focus ring, hover, larger touch target).
  • Reload undoes all of the page's edits when anything the page shows changed meanwhile, or one of the edits is to a saved password or key. The toast says so before the admin presses it. Settings a page keeps hidden (the Meilisearch fields while search uses Postgres) count too, so Reload can undo edits for a change the admin can't see on screen.

Follow-ups

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: 3 (reviewed 761fc6d, 6d1af25, then d0196d4); round 3 fixes in bc0bc0c, 23e04b6, aba69c5 and 45dd421

Member Round 1 Round 2 Round 3
Sol (gpt-6.2-sol, xhigh) 4/10 6/10 6/10
Opus (claude-opus-5-5, high) 8/10 7/10 6/10
Gemini (gemini-4-neon, xhigh) 6/10 6/10 5/10

Visual review: 2 rounds, on captures taken before the PR opened; the toast's text and the Reload outcome have changed since, and the captures linked above are from 45dd421.

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

Round 3 fixed: Reload compared the page with what it showed last, so a change that a background read or a failed reload had already shown didn't count (Codex and Kody found it too); a save started and refused while Reload was reading let that Reload undo the newer edit; Reload checked only the keys a page listed when the save was refused, not other settings it shows or keys it adds later; the wizard's Features step showed marker sharing on but saved nothing after Reload; the AI page kept a passing connection test beside a model Reload replaced. Kody also found a blank secret write counted as set (d939f69) and the AI text test missing the fallback model (4186d3c). Answered: an edit can land before the form's dirty set updates only when code outside an input event makes it at the moment a read settles; the toast's "saved password or key" also covers the Redis database number while a Redis URL is saved.

Round 2 fixed: grouping settings by key prefix undid too much or too little (replaced by all-or-none); a field undone by Reload could show an older value than the next save's baseline; a failed status read undid every edit; a save settling after its edit was taken back left a stale baseline; the Use Redis switch snapped off when turned back on; a password entered for a service was kept while another admin changed that service's server address on the same page (Reload now checks the whole page).

Round 1 fixed: a password or key edit undone without the related edits in its group; a failed reload read put loaded pages behind a load error; a save settling after Discard set a stale baseline; a Redis database edit could move to a changed server; the Use Redis switch could show the wrong state after Reload; a valid reload after the other change was undone was reported as failed; the toast timed out. Kody's race between the two reads is fixed by reading the status after the settings.

Visual fixed: the toast covering the save bar on tablets and phones, an invisible focus ring, no hover state and a 24px target on the toast's button, and an orphaned title word. Answered: the toast's shared styling (icon alignment, text colour, no close button), no per-field mark on replaced edits (the unsaved count drops and the field loses its edited dot), and a walkthrough frame caught mid-animation (measured: once settled the toast sits above the save bar).

Maintainer review: 3 rounds (reviewed 3d9a3c6, 361d49b, then 745c8f9); fixes in 2b01f58, 276173d, 361d49b and 745c8f9

Member Round 1 Round 2 Round 3
Sol (gpt-6.2-sol, xhigh) 5/10 7/10 7/10
Opus (claude-opus-5-5, high) 6.5/10 7.5/10 8/10
Gemini (gemini-4-neon, xhigh) 4/10 7/10 8/10

Maintainer review fixed: toasts covering the settings save bar over a playback bar; the Use Redis switch turning itself off mid-edit, and later hiding a URL changed elsewhere after it was flipped back (the form now exposes resetRevision); a stale Redis connection check result after Reload; wizard prefills staged before the secret status loaded, which made every later Reload undo all edits; a cleared secret recorded as set; a conflict toast left up after a successful save.

AI Disclosure

  • Harness: Claude Code, run from T3 Code
  • Tool(s): Claude Code; translations by silo-translations make translate-pr (Claude Code)
  • Model(s): claude-opus-5-5 (implementation); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (plan, code, and visual reviews)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: a plan round (Sol attacked the plan, Opus cut it, Gemini checked its premises) changed the reload rule; an xhigh code review (three finders, a validation agent, and a sweep) added the per-edit comparison and the secret rule; three background review rounds, Codex and Kody led to the read order, Discard, Redis, keep-all-or-none, whole-page, baseline comparison and save-during-reload fixes; two visual rounds led to the shared toast fixes. See Council review.

🤖 Generated with Claude Code

Note

Fix admin settings save conflicts so a settings page can save again after external changes

  • Adds an admin-settings 412 conflict classifier and makes useSettingsForm own 412 reporting instead of the mutation hook's generic error toast. On conflict, it shows a persistent toast with a reload action.
  • Reload fetches fresh settings and sensitive status, and compares them with the state at edit time. If the page can verify all drafts, they are kept; otherwise all drafts are discarded. Incomplete or stale reloads leave drafts unchanged.
  • Saves are now guarded by the current server snapshot, so new edits after a discard or reset use a fresh ETag rather than the one from an in-flight save.
  • Fixes follow-on issues: Redis switch follows externally configured redis.url state after a taken-back edit, AI connection-test results show only for matching tile values, and setup-wizard prefills wait for sensitive-status loading.
  • Risk: reload discards all drafts when a new or changed secret makes the page unverifiable; check the discard logic in useSettingsForm.ts.

Macroscope summarized 745c8f9.

When settings changed under a page with unsaved edits (another admin or
tab saved, or a restart wrote a changed SILO_* value), every Save was
refused with 412 against the stale snapshot and only Discard got out.

A refused save now keeps the drafts and shows a toast with Reload. Reload
reads the current settings, keeps each edit whose setting still shows the
value it showed when the edit began, undoes the rest (including edits to
saved passwords and keys, which no snapshot shows), and guards the next
save with the new snapshot. Toasts stay above a floating save bar, and
toast action buttons get a focus ring, hover state and touch-size target.

Translations: Silo-Server/silo-translations#120, release 2026.11.20-b4d4933.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 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 6 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: a8d3ff95-67b9-4610-9af8-44e1482e0d3d
Commits

Reviewing files that changed from the base of the PR and between a395106 and 745c8f9.

Files selected for processing: 14

  • web/src/api/v2/adminSettingsSnapshot.ts
  • web/src/components/SaveBar.tsx
  • web/src/components/ui/sonner.tsx
  • web/src/hooks/queries/admin/settings.ts
  • web/src/hooks/queries/admin/settingsWrite.test.ts
  • web/src/hooks/useSettingsForm.reload.test.ts
  • web/src/hooks/useSettingsForm.test.ts
  • web/src/hooks/useSettingsForm.ts
  • web/src/pages/admin-settings/AISettings.tsx
  • web/src/pages/admin-settings/RedisGroup.test.tsx
  • web/src/pages/admin-settings/RedisGroup.tsx
  • web/src/pages/setup-wizard/steps/FeaturesStep.tsx
  • web/src/pages/setup-wizard/steps/ServerStep.tsx
  • web/src/pages/setup-wizard/useStep.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 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-22T03:52:24.341447Z 745c8f9 New commits
🔒 Security Review ✅ Completed 2026-11-22T03:55:08.330433Z 745c8f9 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-kody

silo-kody Bot commented Nov 20, 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 ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish labels Nov 20, 2026
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Quick104 and others added 2 commits November 20, 2026 18:02
…-conflict

# Conflicts:
#	web/src/hooks/useSettingsForm.ts
Reload read the settings and the secret status at the same time, so a
secret set between the two reads could look unset while the snapshot
already carried it, and its edit would be kept. The status is now read
after the settings.

A refetch that another read cancels settles with the record it already
had. Reload took that as a failure only when its version matched the
refused one, which also failed a valid reload after the other change was
undone. It now uses each result only when it was fetched during this
reload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@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 761fc6d)

Reload can preserve a conflicting edit or leave a settings page with no way to retry in place. I verified the form behavior with the settings hook and checked the affected callers.

AI-assisted review by gpt-6.2-sol in the Codex harness through T3 Code.

Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
@silo-kody

silo-kody Bot commented Nov 20, 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 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 761fc6d)

One nit. I found no correctness problem in the reload logic: the generation, mount, save-pending, baseline and refused-validator fences hold for Discard, profile switches, a save racing a reload, and a cancelled refetch. The Redis pair and secret rules match the description.

I checked the shared changes against every caller. All 19 SaveBar callers render at most one bar at a time; CollectionEditor's two bars are exclusive branches. Unmounting a bar clears --save-bar-clearance, so nothing leaks to other pages. The Toaster offsets keep sonner 2.0.7's 24px and 16px side defaults. The action-button restyle reaches the 11 other toasts with an action (Undo and similar). It is an improvement there, but this fix doesn't need it.

Not verified: I did not run the test suite or a browser here; the review is from reading the code.

Written by Claude Opus 5.5 (claude-opus-5-5) running in Claude Code.

Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
- A save that finished after Discard set its snapshot as the next edit's
  baseline and re-created records for the discarded edits, so a later
  Reload could keep an edit over an unseen change or drop a valid one.
  The save's follow-up now applies only while its drafts still exist.
- A Redis database-number edit is undone on Reload when a Redis URL is
  saved: the URL is a secret, so Reload can't tell whether the server the
  number belongs to changed.
- The Use Redis switch follows the stored URL again once no Redis edit is
  staged, not only once the whole page is clean.
- The conflict toast stays until the admin reloads, discards, or reverts
  every edit; it no longer covers the save bar, so it needn't time out.
- Reload no longer checks timestamps: a refetch that another read cancels
  settles with that newer read, and a stale settings record would only
  make the next save refused again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 20, 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 (gemini-4-neon, reviewed 761fc6d)

Four findings from checking the reload, ETag, TanStack Query refetch, and caller interactions against the server and web source:

  • G1 (High) — Failed or partial conflict reloads flip TanStack Query's isError, stranding StorageSettings in a dead-end alert (with <SaveBar> unmounted and the conflict toast dismissed) and tearing down NotificationsAdminSettings, AdminBackups, and wizard FeaturesStep on a transient reload failure.
  • G2 (Medium) — Editing redis.db alone keeps the draft across Reload even when redis.url changed to another Redis server with the same effective database number.
  • G3 (Medium) — RedisGroup's "Use Redis" switch stays stuck OFF after Reload undoes a staged disable while keeping another dirty field on General Settings.
  • G4 (Low) — freshTag === refusedWith.current rejects a valid reload when another admin reverts a previously stored setting back to the same content-hash ETag.

Details and suggested repairs are on the relevant lines below.

AI-assisted review: gemini-4-neon via Antigravity in T3 Code.

Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
A failed settings read during Reload turned the form's loadError on even
though the snapshot was still loaded, and pages that show a load error
replaced the form, drafts and all. loadError now means what it says: the
snapshot never loaded, like the secret status since #4673.

The Use Redis switch also follows the stored URL again when the page goes
clean, not only when its Redis edits clear: switching Redis on with no
URL saved stages nothing, so Discard has to reset it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 20, 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 and others added 2 commits November 20, 2026 18:41
When Reload undoes an edit to a saved password or key, it now also undoes
the other edits in that setting's group (the keys sharing its prefix,
such as a service's server address), so a service's settings are saved
together with the credential they were entered with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-conflict

# Conflicts:
#	.silo-translations
#	web/src/locales/keys.ts
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. labels Nov 20, 2026
@silo-kody

silo-kody Bot commented Nov 20, 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 ❌

Comment thread web/src/hooks/useSettingsForm.ts Resolved
Quick104 and others added 2 commits November 20, 2026 20:17
A Reload checked only for a save still in flight. A save the admin started
and the server refused while Reload was still reading slipped past, and
Reload then undid the edit the admin made after pressing it. Compare the save
counter instead, so any save started meanwhile retires the Reload; its
refusal offers Reload again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The AI page cleared its test results on its own Discard and on edits, but a
Reload after a refused save can undo a tile's edits without either, leaving a
passing test next to the model it replaced. Keep each result with the values
it tested and show it only while the tile still holds them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 ❌

The server trims what it stores, so a password or key saved as spaces is
cleared. The baseline a save leaves for the edits still staged counted it as
set, and a later Reload then undid edits it could have kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Verified round-3 findings (ranked by impact):

  1. G9 (FeaturesStep after Reload undoes edits): Reload clears the prefilled markers.share_by_default = "true" draft while sharePrefilled.current stays true, leaving the toggle rendered as ON ("" !== "false") with dirtyCount === 0 so Continue skips saving and leaves sharing off.
  2. G10 (pages reading settings outside keys): pageChanged checks only stableKeys, so changes to settings read or shown on a page outside the array passed to useSettingsForm (AdminBackups, SecurityAccessSettings, DownloadsSettings, NotificationsAdminSettings, AppearanceSettings) do not trigger an undo on Reload.
  3. G11 (stale stableKeys in toast closure): reloadAfterConflict closes over stableKeys instead of a ref, so on PlaybackSettings a 412 toast raised before useLibraryCapabilities() resolves misses trickplay keys when Reload runs later.
  4. G12 (dirtyRef.current lags passive useEffect): dirtyRef.current updates only in a passive useEffect, whereas editVersions and editedOver update synchronously, leaving a window where an edit or resetValue before passive effects flush causes reloadAfterConflict to drop only part of the drafts or save() to treat a taken-back edit as still staged.

AI disclosure: reviewed with gemini-4-neon via Antigravity in T3 Code.

Comment thread web/src/pages/setup-wizard/useStep.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Quick104 and others added 2 commits November 20, 2026 20:30
Reload checked only the keys a page passed to the form, as they were when
the save was refused. Pages also show settings they read through the form
without listing them, and some add keys once a capability loads. Record
every key the page reads through the form along with its keys, and check
them all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The setup wizard's Features step staged sharing on once, while nothing was
stored. A Reload that undid the step's edits left the switch showing on with
nothing staged, so Continue saved nothing and sharing stayed off. Stage the
default whenever nothing is stored and nothing is staged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 ❌

The text tile shows the subtitle model while no text model is set, and a
Reload can change that one. Include the shown model in what a text test
result was run with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4186d3cb8a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +393 to +395
!dirtyRef.current.has(key) &&
(valueIn(baseline, key) !== valueIn(fresh, key) ||
secretsThen.includes(key) !== configured.includes(key)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat unchanged secret-presence flags as unverifiable

If an admin stages an SMTP host change while another admin replaces the already-configured SMTP password, Reload retains the host draft: the password is absent from both snapshots and its configured flag remains true, so this comparison misses the change. Because unverifiable only checks dirty keys, the unedited password does not trigger reconciliation either. Reload then advances the save baseline, allowing the next Save to combine the staged host with a password it was not entered against, potentially breaking authentication or sending the replacement credential to the wrong server. Treat related configured secrets as unverifiable even when they were not edited locally, or use secret revision information to establish that they are unchanged.

Useful? React with 👍 / 👎.

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.

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

Checked on 361d49b. The snapshot and the secret status can't show a saved secret replaced by another value, so Reload keeps a non-secret edit over it. That edit then saves exactly what the admin would have saved after opening the page fresh: the password still shows as set and the host is the one they typed. The save still sends only the edited keys and is guarded by the fresh ETag, so nothing the page shows is overwritten unseen. Catching a rotation would need a per-secret revision from the server, for example in sensitive-status. I've put that to the maintainers as a possible follow-up rather than blocking this PR on it.

Re-pins translations to 2026.11.22-114155f, which carries both main's keys and this branch's.
@silo-triage silo-triage Bot added size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Nov 22, 2026
@silo-triage silo-triage Bot added size/XL 500–999 added + deleted lines (all files); change volume, not priority. and removed size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. labels Nov 22, 2026
@silo-kody

This comment has been minimized.

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

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

Maintainer review of 3d9a3c6, which is the branch with main merged in. The pin now stays on main's translation release, which already has the four conflict strings, so this PR no longer changes any locale file. The fix holds up live. On a sandbox built from this head, a save refused after another admin changed the log level offered Reload, kept the Server name edit, and saved with the new validator (200). A refused save after a change to Login subtitle on the same page undid the edit. The new reload tests fail on main.

Six findings: five on their lines below, one here. I'm fixing all of them in commits on this branch, so there's no need to change anything yourself.

Minor: the Redis connection check result outlives a reload. RedisGroup holds its check result in plain state, so after a Reload undoes staged Redis edits, the green result for the replaced URL or number stays beside the restored values. This is the same thing this PR fixes on the AI page. Repair: use the existing useConnectionCheck helper, which shows a result only while the request it checked still matches.

Comment thread web/src/components/SaveBar.tsx Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Comment thread web/src/hooks/useSettingsForm.ts Resolved
Quick104 and others added 3 commits November 22, 2026 03:32
The settings pill rises above a background watch or audiobook bar, but the
clearance it published for toasts didn't, so a toast covered Discard and Save.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An edit staged before the status arrived recorded it as unknown, so a later
Reload after a refused save undid every edit even when only another page
changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…undone

The form now counts saves, Discards, profile switches, and Reloads that undo
the drafts, and the Use Redis switch follows the stored URL again only when
that count changes. Before, typing the database number back to its saved
value turned the switch off mid-edit. The Redis connection check uses the
shared helper, so its result shows only beside the values it checked. A
secret cleared and retyped during a save is no longer recorded as set, and
an acknowledged save dismisses a conflict toast shown before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌

…t was flipped back

Turning Use Redis on and back off with no URL saved, or off and back on with
one saved, left an override that hid a URL another admin saved or removed
afterwards. Those flips now leave the switch following the stored URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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

Copy link
Copy Markdown
Contributor Author

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

Maintainer review summary

Reviewed head: 745c8f9e. The branch is now up to date with main: main is merged in, and the translation pin stays on main's release, which already carries the four conflict strings, so the PR no longer changes any locale file.

Fit: 8/10 · Readiness: 8/10 · conditional (assuming CI is green)

What I checked

  • The bug is real, and the fix works live. On a dev sandbox built from this branch (361d49bb; the final commit only changes the Use Redis switch), Settings → General behaved as follows:
    • Another admin changed the log level. Two Saves were refused with 412 and the same If-Match. Reload kept the Server name edit, and the next Save answered 200 with the new validator. The other admin's log level stayed stored.
    • Another admin changed Login subtitle on the same page. Reload undid the edit and showed the other admin's value.
    • With a 72px playback bar clearance set, the toast sat above the settings save bar.
  • Tests: all three tests in useSettingsForm.reload.test.ts and the two new baseline tests in useSettingsForm.test.ts fail on main. The refused save offers no Reload.
  • Overlap with fix(web): stop emptied settings fields from staging values they don't show #4816: that PR edits useSettingsForm.ts, its tests, and RedisGroup.tsx, so whichever PR merges second has text conflicts to resolve. This branch now exposes form.resetRevision. It changes on a save, Discard, a profile switch, or a Reload that undoes the drafts. fix(web): stop emptied settings fields from staging values they don't show #4816 can read it instead of passing its own savesAndDiscards count into RedisGroup, and fix(web): stop emptied settings fields from staging values they don't show #4816's change to the clean-form baseline effect (keying on dirty) should keep calling dismissConflict().

Addressed in this review

Commits 2b01f58a, 276173d8, 361d49bb and 745c8f9e. The threads on the findings have the details.

  • Toasts covered the settings save bar while a playback bar showed.
  • The Use Redis switch turned itself off when the database number was typed back to its saved value. A later fix made the switch follow a URL saved or removed elsewhere after it was flipped back; two new tests fail without it.
  • The Redis connection check result outlived a Reload that undid its values. It now uses the shared useConnectionCheck helper.
  • The setup wizard's prefills ran before the secret status loaded. Every later Reload on those steps then undid all edits.
  • A secret cleared during a save and typed again was recorded as set.
  • A conflict toast stayed up after a later save went through.

Left for the maintainers

  • A saved password or key replaced by another admin can't be seen on the page, because only its set/unset state shows. Reload then keeps a non-secret edit next to it. A freshly opened page would show the same thing, so I didn't treat it as a defect. Catching it would take a per-secret revision from the server.
  • Reload that undoes the edits gives no message afterwards. The toast explains the rule before the click. A short follow-up message would need a new catalog string.
  • Smaller follow-ups: the five direct useUpdateServerSettings callers ([bug] Settings saved outside the settings form stay refused after a change elsewhere #4685) and the Jellyfin compatibility toggle's writer still don't refresh after a 412. Search and Storage connection checks keep a result after Reload, as Redis did. An environment variable taking over a setting drops that one draft on its own, which predates this PR. A no-op edit on a clean form pins the edit baseline; that also predates this PR, and fix(web): stop emptied settings fields from staging values they don't show #4816 touches it.

Fit and readiness

  • Fit 8: it fixes a dead end in day-to-day administration, where a page could stop saving for good, without adding a setting. It reuses the server's existing validator. What holds the score down is how much draft bookkeeping now lives in the shared form hook.
  • Readiness 8: the behavior was shown live, and the PR's tests fail on main. Two things remain conditions: the merge has to be coordinated with fix(web): stop emptied settings fields from staging values they don't show #4816, and the validated-features check against the 1.0 board didn't run in this review.

Validation

  • Validated features: not checked against the 1.0 validation board this time; that check didn't run.
  • User manual: unaffected. No page on siloserver.org covers saving settings when they change elsewhere.
  • Apple and Android: no parity work is needed. Only the web admin edits server settings.

Council

Member Round 1 (3d9a3c64) Round 2 (361d49bb) Round 3 (745c8f9e)
Sol (gpt-6.2-sol, xhigh) 5/10 7/10 7/10
Opus (claude-opus-5-5, high) 6.5/10 7.5/10 8/10
Gemini (gemini-4-neon, xhigh) 4/10 7/10 8/10

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4684-review/

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 priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant