Production engineering
Reveal answer and reasoning
A write precondition must be evaluated against current selected state at the point that owns the mutation. This endpoint requires If-Match, parses the full candidate list and uses strong comparison. It begins its SQLite write transaction before reading the current version and evaluating that list, then keeps an expected-version condition on the UPDATE. That avoids both a lost write and a stale pre-read narrowing a valid multi-tag request.
The portable helper tests known integer versions and a weak flag only. It does not parse headers, acquire a write lock or simulate database concurrency.
A preliminary read plus a conditional UPDATE can protect a single expected version yet still mishandle a multi-tag list if the application first reduces that list to its stale observed version. It can also reject before an accepted candidate becomes current. The corrected fixture reads and evaluates inside the write transaction. Do not replace this with a lock around an unrelated in-memory object and claim cross-process protection.
Strong comparison also rejects weak validators for this write; accepting a weak read token here would silently change the concurrency contract. None of these checks decides who is authorized to edit the document. The pause control is restricted to the Development fixture and occurs before transaction creation, allowing the second writer to commit without waiting on that paused request.
What a strong answer covers
- The console advances version1 to2 once, then rejects stale and weak inputs.
- Actual missing If-Match is428; a stale or weak mismatch is412 without a write.
- The full parsed list is evaluated after reading current state inside the same SQLite write transaction.
Common pitfall
Assuming a pre-read narrowed to one version preserves the semantics of the entire If-Match list.
Follow-up questions
- How can a stale pre-read reject a still-valid multi-tag condition?
- Which user-facing merge and authorization decisions remain after a412?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.