Skip to content

control: settings save no longer wipes unsent config fields#18

Merged
REPPL merged 1 commit into
mainfrom
fix/settings-config-roundtrip
Jul 18, 2026
Merged

control: settings save no longer wipes unsent config fields#18
REPPL merged 1 commit into
mainfrom
fix/settings-config-roundtrip

Conversation

@REPPL

@REPPL REPPL commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Found by a WebUI-consistency review pass — the highest-severity of the batch.

handleSetSettings decoded the settings POST body into a fresh zero-valued
config.Config and persisted it wholesale via SetConfig. Any field the
settings form doesn't send was therefore silently reset:

  • A user with preload: [...] lost their warm-load list on any unrelated
    settings change (e.g. bumping the idle timeout).
  • app.js hardcoded advertise: true in the body, so every save re-enabled LAN
    advertising — with no UI control to turn it back off.

Fix: decode into a copy of the current config, so fields the form omits keep
their existing value; drop the hardcoded advertise from the form body so it's
preserved rather than forced on. The api_key/hf_token redacted-placeholder
handling is unchanged.

Test posts a realistic form body (host/port/idle/etc, no advertise/preload) and
asserts Preload and Advertise survive while the sent field applies — it fails
against the old code (Preload wiped) and passes with the fix.

More findings from the same review (download integrity, UI loading/cancel states)
are coming as separate PRs.

Assisted-by: Claude:claude-fable-5

handleSetSettings decoded the POST body into a fresh zero-valued config.Config
and persisted it wholesale, so any field the settings form does not send was
silently reset. A user with a preload list lost it on any unrelated settings
change, and app.js hardcoding advertise:true re-enabled LAN advertising on
every save (with no way to turn it off from the panel).

Decode into a copy of the CURRENT config instead, so omitted fields keep their
value; drop the hardcoded advertise from the form body so it is preserved
rather than forced on. The api_key/hf_token redacted-placeholder handling is
unchanged. Test posts a realistic form body and asserts Preload and Advertise
survive while the sent field applies.

Assisted-by: Claude:claude-fable-5
@REPPL
REPPL merged commit 8a129e2 into main Jul 18, 2026
6 checks passed
@REPPL
REPPL deleted the fix/settings-config-roundtrip branch July 18, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant