Repository navigation
fix: atomically apply profile If-Match updates - #11
Merged
Merged
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Concurrent profile PATCH requests could all pass the same If-Match check and then overwrite each other. A current-main reproduction sent 16 requests with one ETag and observed three successful writes.
The update now includes the expected revision in its SQL condition and checks RowsAffected. The write and returned-profile read share one transaction, so the response body and ETag identify that commit. The expected revision remains immutable across the store's existing transaction retries. No new API fields or schema changes are introduced.
The real HTTP/SQLite regression now passes: exactly one winner, 15 precondition failures, one persisted revision increment, stale-patch rejection, unchanged invalid-timezone behavior, partial-patch field preservation and rollback after an actual SQLite trigger rejects an update.
Local focused test passed. Broader local package runs timed out without a confirmed result; full CI is required before merge. Addresses FT-03 in #1.