fix(rest): let If-Match "0" write the first user-settings version - #443
Closed
angela-helios wants to merge 1 commit into
Closed
fix(rest): let If-Match "0" write the first user-settings version#443angela-helios wants to merge 1 commit into
angela-helios wants to merge 1 commit into
Conversation
GET serves the empty settings document as a real representation ({} with
ETag "0"), but check_if_match mapped version 0 to 'no representation',
so the validator the GET handed out could never satisfy a conditional
write: a fresh user's read-then-conditional-write 412'd forever. Concrete
tag lists now evaluate against the version number including 0; If-Match: *
keeps requiring an actually stored document. The storage layer already
treated an expected version 0 as insert-if-absent on all four backends.
Closes #442
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Folded into #440 per review flow — its branch already carries this commit ( |
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.
Closes #442
GET /_user/settingsserves the empty document as a real representation —{}withETag: "0"— butcheck_if_matchmapped version 0 to "no current representation", so the exact validator the GET handed out could never satisfy a conditional write. A fresh user's read-then-conditional-write (saved-queries.js's roaming recents do exactly this) retried into 412 forever. It went unnoticed because nav.js used to create the document with an unconditional PATCH on the first toggle; #438 removes nav.js, and PR #440's CI then failed deterministically onqueries.spec.ts › a run is recorded under the Recent disclosure— the trace shows the threePATCH → 412withIf-Match: "0"against a fresh database.Concrete tag lists now evaluate against the version number including 0, so
"0"round-trips;If-Match: *keeps requiring an actually stored document. No storage changes: all four backends already treat an expected version 0 as insert-if-absent.Tests: fresh-store round-trip (GET etag "0" → conditional PATCH creates version 1 → "0" is then genuinely stale again) and the
*-still-requires-existence guard. 25/25 inuser_settings.Note for #440: its e2e
Recentfailure is this bug surfacing; once this merges, #440 rebases green.