feat(settings): atomic bulk write + read-only test-providers [server] (ENG-1126) - #248
Closed
pnewsam wants to merge 1 commit into
Closed
feat(settings): atomic bulk write + read-only test-providers [server] (ENG-1126)#248pnewsam wants to merge 1 commit into
pnewsam wants to merge 1 commit into
Conversation
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>
No PR environment for this pull requestAdd the Updated on every push to this PR. |
Contributor
Author
|
Consolidated into #249 (one settings-desync PR per repo). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of ENG-941 (settings CRUD refactor). Server half of ENG-1126. Draft.
Two write-honesty fixes.
Atomic saves. Adds
PUT /settings(bulk), backed bySettingService.save_all, which validates every key and writes them in one transaction — all-or-nothing. The Settings form moves onto this from the per-keyPUT /{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-providersno longer persistsprovider_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.