Repository navigation
Commit 2f15c67
committed
fix(domain model): drop cross-module associations with the entity they end at
DROP ENTITY swept only the regular Associations collection, so every
CROSS-MODULE association pointing at the deleted entity survived. Dropping the
local BY-ID (FROM) end left a 16-byte pointer to an element that no longer
exists, and mxbuild 11.14.0 could then not LOAD the project:
ERROR: System.AggregateException … (The given key
'49751a65-d5f9-456c-887e-3f14bacb8822' was not present in the dictionary.)
at StreamingBsonUnitReader.ResolvePostponedProperties()
No CE code and no document named — the failure is in the storage layer, above
the consistency checker, so it reads as "the project is corrupt". Dropping the
BY-NAME (TO) end is milder and still wrong: CE1613 at the cross-module
association.
removeCrossAssocsReferencing matches both ends, because a cross-module
association addresses them differently: FROM by element id (local to this
domain model), TO by qualified name (it lives in another module). Called from
DeleteEntity locally and in its cascade over the other domain models.
Reported against a VIEW entity, whose associations are derived from its OQL so
there is no CREATE ASSOCIATION to undo. Nothing here is view-entity specific:
the first probe — view entity and source entity in the SAME module — did not
reproduce, and that negative is what identified cross-module as the variable. A
plain `create association A.X from A.X to B.Y` plus `drop entity A.X`
reproduces the identical crash.
Measured on mxbuild 11.14.0, one project carrying all three shapes:
before drop by-id end project does not load (exception above)
drop by-name end CE1613 at the cross-module association
after all three drops project loads, 0 errors
Controls: an untouched cross-module association survives both deletes (in the
unit test and in the bug-test), and the single-module case still works. Before
the fix the new test fails in both directions with the orphan left behind.
Closes #553
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2aYb3zDscezm874CDTH6R1 parent 0ecde78 commit 2f15c67
4 files changed
Lines changed: 255 additions & 1 deletion
File tree
- .claude/skills/fix-issue/findings
- mdl-examples/bug-tests
- mdl/backend/modelsdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 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 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
64 | 102 | | |
65 | 103 | | |
66 | 104 | | |
| |||
314 | 352 | | |
315 | 353 | | |
316 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
317 | 364 | | |
318 | 365 | | |
| 366 | + | |
319 | 367 | | |
320 | 368 | | |
321 | 369 | | |
| |||
338 | 386 | | |
339 | 387 | | |
340 | 388 | | |
341 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
342 | 397 | | |
343 | 398 | | |
344 | 399 | | |
| |||
0 commit comments