Skip to content

fix: atomically apply profile If-Match updates - #11

Merged
HsukqiLee merged 1 commit into
mainfrom
fix/profile-conditional-update
Nov 16, 2026
Merged

HsukqiLee merged 1 commit into
mainfrom
fix/profile-conditional-update

Conversation

@HsukqiLee

Copy link
Copy Markdown
Collaborator

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.

@HsukqiLee
HsukqiLee merged commit 90619dd into main Nov 16, 2026
3 checks passed
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