Commit 2873eb9
* fix(metadata-protocol): restoreVersion carries the row's package binding (#6215)
restoreVersion read the active row package-agnostically and then re-put the
historical body without stating a packageId. `put` scopes its optimistic-lock
lookup by package and an unstated packageId resolves to the UNBOUND row
(`package_id IS NULL`), so for a package-bound overlay the lock looked up a row
that does not exist, read a null parent hash, and threw ConflictError — every
rollback of a row authored in a Studio package workspace answered 409
"advanced during rollback" while nothing had advanced. Both user-facing callers
(rollbackMetaItem, revertCommit) go through this one call.
restoreVersion now takes both the parent hash and the ADR-0048 package_id from
one raw read of the active row and states the binding on the write, as
promoteDraft already did — closing the second face too (an insert of a
duplicate unbound row instead of an update of the bound one).
Tests: the #4636 PR1 tripwire is flipped to the staged assertion (a
package-bound rollback succeeds AND re-registers under the row's own package
key), revertCommit gains a real-repository pin on a package-bound row, and both
callers keep a genuine-conflict refusal.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDU3qAuJyajAQm3GkUXdfA
* test(objectql): pin both restoreVersion callers on a package-bound row (#6215)
- protocol-writepath-object-ownership: the #4636 PR1 tripwire is replaced by
the assertion staged one test above it — a package-bound rollback succeeds,
the registry write-through carries the row's OWN package id, the restored
body is what the registry serves, and exactly one row (still bound) survives,
which is the defect's duplicate-unbound-row second face.
- protocol-commit-history: revertCommit's restore limb driven against the REAL
SysMetadataRepository over a package-aware engine double, plus the
package-less control.
- Both callers keep a genuine-conflict refusal: a row that really advanced
between the parent read and the optimistic-lock read is still refused
(METADATA_CONFLICT / 409 at the throwing surface, code in revertCommit's
failed[] record). The race is staged on the in-transaction read rather than
by counting reads, so the pin cannot rot into a green that asserts nothing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KDU3qAuJyajAQm3GkUXdfA
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7c6261a commit 2873eb9
4 files changed
Lines changed: 433 additions & 23 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- objectql/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 | + | |
Lines changed: 53 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
389 | 403 | | |
390 | 404 | | |
391 | 405 | | |
392 | 406 | | |
393 | 407 | | |
394 | 408 | | |
395 | 409 | | |
396 | | - | |
| 410 | + | |
397 | 411 | | |
398 | 412 | | |
399 | 413 | | |
| |||
436 | 450 | | |
437 | 451 | | |
438 | 452 | | |
439 | | - | |
| 453 | + | |
440 | 454 | | |
441 | | - | |
| 455 | + | |
442 | 456 | | |
443 | 457 | | |
444 | 458 | | |
| |||
723 | 737 | | |
724 | 738 | | |
725 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
726 | 745 | | |
727 | 746 | | |
728 | 747 | | |
| |||
759 | 778 | | |
760 | 779 | | |
761 | 780 | | |
762 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
763 | 805 | | |
764 | 806 | | |
765 | 807 | | |
| |||
768 | 810 | | |
769 | 811 | | |
770 | 812 | | |
| 813 | + | |
771 | 814 | | |
772 | 815 | | |
773 | 816 | | |
| |||
1051 | 1094 | | |
1052 | 1095 | | |
1053 | 1096 | | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1057 | 1103 | | |
1058 | 1104 | | |
1059 | 1105 | | |
| |||
0 commit comments