Skip to content

fix(web): quick back-to-back settings changes no longer undo each other - #256

Merged
AadiJo merged 1 commit into
mainfrom
optimistic-settings-saves
Nov 15, 2026
Merged

AadiJo merged 1 commit into
mainfrom
optimistic-settings-saves

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Changing a setting before an earlier save was answered could undo the earlier change. Each save sends whole maps such as providerInstances, built from the client's copy of the settings, and that copy only moved when the server's settings stream delivered. On a slow connection, turning Codex off and then Claude off in Settings > Providers left Codex back on.

The settings hooks now apply patches that are sent and not yet answered, so every reader, and the next save, builds on them. Once a save is answered, the server's answer stands in until the settings stream delivers its own update. Without that, each saved change flips back for a moment, because the answer arrives just before the stream update. A save the server rejects is dropped again.

Proof: the new apps/server/scripts/settings-save-race-e2e.ts holds the server's WebSocket replies, turns Codex off and then Claude off, and releases them. Before: both switches stayed on while held, and Codex ended up on with its saved entry gone. After: both read off at once, both save as off, and neither flips back while the answers arrive (3 of 3 runs). Typecheck, vp check and the web suite (1900 tests) pass. A rejected save is not covered by a test.

Known limitation: if a save's stream update were delivered after a later save's answer, the later change would show as undone until its own stream update arrives. The server publishes each save's update before it answers that save, and the app sends the next save only after that answer, so no ordinary sequence is known to produce this.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol on high. Sol verdict: approved


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cadsense Skipped Skipped Nov 15, 2026 4:43am UTC

@AadiJo
AadiJo force-pushed the optimistic-settings-saves branch from ff3d160 to e345095 Compare November 13, 2026 20:58
@AadiJo
AadiJo changed the base branch from check-ollama-model-picker to main November 15, 2026 04:43
@AadiJo
AadiJo force-pushed the optimistic-settings-saves branch from e345095 to 1022285 Compare November 15, 2026 04:43
@AadiJo
AadiJo merged commit bc9437e into main Nov 15, 2026
12 checks passed
@AadiJo
AadiJo deleted the optimistic-settings-saves branch November 26, 2026 19:51

This branch was previously deployed

1 inactive deployment
Preview — 10222859 Deployed Nov 15, 2026 by vercel[bot]
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