Commit 16f2ea2
committed
fix(super-editor): throw REVISION_MISMATCH on metadata dry-run (SD-3104)
Follow-up on the previous dry-run fix. Returning a structured
{ success: false, failure: { code: 'REVISION_MISMATCH' } } on the
attach/remove dry-run paths was shape-inconsistent: the live paths and
the metadata.update dry-run all reach checkRevision via
executeDomainCommand or executeOutOfBandMutation, both of which throw
PlanError. A consumer wrapping these calls in one try/catch couldn't
treat the two failure modes uniformly.
Calls checkRevision directly in the attach + remove dry-run early-return
paths so they throw on stale revisions, matching every other path. Drops
the local REVISION_MISMATCH from the FailureCode union and the
revisionMismatchFailure helper. Updates the two new unit tests to assert
the throw.
Also declares REVISION_MISMATCH on metadata.attach/update/remove throws
arrays in operation-definitions, which the contract was missing.1 parent fbd1b16 commit 16f2ea2
7 files changed
Lines changed: 35 additions & 51 deletions
File tree
- apps/docs/document-api/reference
- metadata
- packages
- document-api/src/contract
- super-editor/src/editors/v1/document-api-adapters/plan-engine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
| 1080 | + | |
1081 | 1081 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6363 | 6363 | | |
6364 | 6364 | | |
6365 | 6365 | | |
6366 | | - | |
| 6366 | + | |
6367 | 6367 | | |
6368 | 6368 | | |
6369 | 6369 | | |
| |||
6403 | 6403 | | |
6404 | 6404 | | |
6405 | 6405 | | |
6406 | | - | |
| 6406 | + | |
6407 | 6407 | | |
6408 | 6408 | | |
6409 | 6409 | | |
| |||
6419 | 6419 | | |
6420 | 6420 | | |
6421 | 6421 | | |
6422 | | - | |
| 6422 | + | |
6423 | 6423 | | |
6424 | 6424 | | |
6425 | 6425 | | |
| |||
Lines changed: 19 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
248 | 247 | | |
249 | 248 | | |
250 | 249 | | |
251 | | - | |
| 250 | + | |
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
273 | 269 | | |
274 | 270 | | |
275 | 271 | | |
| |||
Lines changed: 9 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 83 | | |
102 | 84 | | |
103 | 85 | | |
| |||
481 | 463 | | |
482 | 464 | | |
483 | 465 | | |
484 | | - | |
485 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
486 | 470 | | |
487 | 471 | | |
488 | 472 | | |
| |||
540 | 524 | | |
541 | 525 | | |
542 | 526 | | |
543 | | - | |
544 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
545 | 530 | | |
546 | 531 | | |
547 | 532 | | |
| |||
0 commit comments