Commit f3d4d82
committed
fix(metadata-protocol): a single-record update binds the PATH row, not the body's id (#6479)
`updateData` probed existence and validated OCC against the path `:id`, built
`{ where: { id: request.id } }`, and then handed the request body to the engine
verbatim — where a truthy scalar `data.id` outranks `where.id`. A body of
`{"id":"rec_2"}` on `PATCH /data/task/rec_1` therefore probed rec_1,
version-checked rec_1, WROTE rec_2, and answered `id: rec_1` beside rec_2's
readback: a silent cross-row write straight past the caller's own `If-Match`.
The path id is now merged over the payload before dispatch
(`{ ...request.data, id: request.id }`) — the same shape the bulk ingress in
`rest-server.ts` has always used, so the repo's two single-write ingresses give
one answer (#4550 / #4434). Triage ruling A of 2026-08-08; routes B (400 on
mismatch) and C (schema ban) were explicitly rejected, and neither the engine's
payload-first dispatch (#5748) nor its by-id payload strip (#6435) is touched.
A non-record payload (`undefined`, `null`, an array) passes through untouched so
this ingress is never kinder than the producer about a malformed call.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6bLax4KMrSfnE1ydFU8Dw1 parent e6025e9 commit f3d4d82
3 files changed
Lines changed: 416 additions & 1 deletion
File tree
- .changeset
- packages/metadata-protocol/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5756 | 5756 | | |
5757 | 5757 | | |
5758 | 5758 | | |
5759 | | - | |
| 5759 | + | |
| 5760 | + | |
| 5761 | + | |
| 5762 | + | |
| 5763 | + | |
| 5764 | + | |
| 5765 | + | |
| 5766 | + | |
| 5767 | + | |
| 5768 | + | |
| 5769 | + | |
| 5770 | + | |
| 5771 | + | |
| 5772 | + | |
| 5773 | + | |
| 5774 | + | |
| 5775 | + | |
| 5776 | + | |
| 5777 | + | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
| 5805 | + | |
| 5806 | + | |
| 5807 | + | |
5760 | 5808 | | |
5761 | 5809 | | |
5762 | 5810 | | |
| |||
0 commit comments