Skip to content

feat(settings): atomic bulk write + read-only test-providers [server] (ENG-1126) - #248

Closed
pnewsam wants to merge 1 commit into
stagingfrom
paul/eng-1126-atomic-writes-server
Closed

feat(settings): atomic bulk write + read-only test-providers [server] (ENG-1126)#248
pnewsam wants to merge 1 commit into
stagingfrom
paul/eng-1126-atomic-writes-server

Conversation

@pnewsam

@pnewsam pnewsam commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Part of ENG-941 (settings CRUD refactor). Server half of ENG-1126. Draft.

Two write-honesty fixes.

Atomic saves. Adds PUT /settings (bulk), backed by SettingService.save_all, which validates every key and writes them in one transaction — all-or-nothing. The Settings form moves onto this from the per-key PUT /{key} loop (client side, next PR), which could leave the DB half-written when one key in a save failed.

No silent write on test. POST /test-providers no longer persists provider_status. A test is a read; persisting it made a stale green dot outlive a revoked key or a drained wallet and still read as passing (ENG-335). Callers render the returned results directly.

No storage or auth change. Tests cover the atomicity, the 400-on-invalid path, and that a test writes nothing.

Server half of the ENG-941 settings-CRUD refactor (PR2). Two write-honesty fixes.

Atomic saves: add PUT /settings (bulk), backed by SettingService.save_all, which
validates every key and writes them in one transaction — all-or-nothing. The
Settings form will move onto this from the per-key PUT /{key} loop, which could
leave the DB half-written when one key in a logical save failed. Extracts a
shared _encode_for_store/_write_row helper so upsert_setting and save_all share
one encode path.

No silent write on test: POST /test-providers no longer persists provider_status.
A "test" is a read; persisting it made a stale green dot outlive a revoked key or
a drained wallet and still read as passing (ENG-335). Callers render the returned
results directly.

No storage or auth change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

No PR environment for this pull request

Add the deploy label and push to create one. It is torn down when the label is removed or the PR closes, so any URL you saw here earlier is gone.

Updated on every push to this PR.

@pnewsam

pnewsam commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #249 (one settings-desync PR per repo).

@pnewsam pnewsam closed this Jul 28, 2026
@pnewsam
pnewsam deleted the paul/eng-1126-atomic-writes-server branch July 28, 2026 19:40
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant