You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8372e0a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(metadata-protocol): the by-id OCC comparison hands over only a row absent from the caller's read
A caller re-read that throws now propagates as raised again, refusals
included; only a read that returns no row leaves the answer to the write door.
The docblocks, the changeset and the http-protocol paragraph describe that
absent-row case only. Pins: a write grant without a read grant keeps its
stale-token write from running at the protocol double and at the runtime
doors; the dogfood families whose read is refused compare status and code.
Claude-Session: https://claude.ai/code/session_017xRBcVy4VXmkQjn2MGeaWk
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/harden-occ-unreadable-row-write-door.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
'@objectstack/metadata-protocol': patch
3
3
---
4
4
5
-
fix(metadata-protocol): the by-id OCC comparison answers only for a row the caller reads; every other row gets the write door's answer
5
+
fix(metadata-protocol): the by-id OCC comparison hands a row absent from the caller's read to the write door
6
6
7
7
Clause-②: no
8
8
Metadata-protocol: none
9
9
10
-
`updateData` and `deleteData` compare a caller's version token (`If-Match`, or `expectedVersion`) before the write is authorized. On a mismatch they re-read the row as the caller. When that read returns no row, or refuses with a declared client-band status, the comparison is now dropped and the request goes on to the write, whose door answers it: the same status, code and sentence the request gets without a token, and the same a token on an id naming no row gets. This restores the governing text for the write doors (ruling of record 5985885287).
10
+
`updateData` and `deleteData` compare a caller's version token (`If-Match`, or `expectedVersion`) before the write is authorized. On a mismatch they re-read the row as the caller. When that read returns no row, the comparison is now dropped and the request goes on to the write, whose door answers it: the answer the request gets without a token, and the answer a token on an id naming no row gets. This restores the governing text for the write doors (ruling of record 5985885287).
11
11
12
-
-**Unchanged:** a row the caller reads still answers `409 CONCURRENT_UPDATE` with that row as `currentRecord`, including a row the caller reads but may not write. A matching token, or none, reads nothing more than before. A read that faults (a server-band status, or none declared) still propagates as raised.
13
-
-**The write door's answers:** a caller who may not update or delete the object gets that refusal (`403`), token or none; a caller who may write the object gets `404 RECORD_NOT_FOUND` for a row its read does not return, as for an id naming no row.
12
+
-**Unchanged:** a row the caller reads still answers `409 CONCURRENT_UPDATE` with that row as `currentRecord`, including a row the caller reads but may not write. A caller read that throws — a refusal or a fault — propagates as raised, as before. A matching token, or none, reads nothing more than before.
13
+
-**The write door's answers for a row absent from the caller's read:** a caller who may not update or delete the object gets that refusal (`403`); a caller who may write the object gets `404 RECORD_NOT_FOUND`, as for an id naming no row.
it('the caller\'s read REFUSES and the write door admits the write (a write grant without a read grant): the read refusal propagates and nothing is written',async()=>{
445
+
const{ p, store, update, del }=makeProtocol({real: row('real')},{readRefusal: readRefusalError});
0 commit comments