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 e0831fe
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .claude/skills/fix-issue/findings/mdl-backend.jsonl
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -119,3 +119,4 @@
119
119
{"area": "mdl/backend", "date": "2026-09-20", "symptom": "Every page mxcli wrote carried `Autofocus` (a property Mendix introduced in 11.1.0) and every page and snippet carried `Variables` (10.17.0), whatever the project's version. On a Mendix 10 project the document therefore held a key that project's metamodel does not declare — the class of defect that makes Studio Pro throw InvalidOperationException at MprProperty.cs while mxbuild reports 0 errors. Found while fixing mendixlabs/mxcli#1121 (the same defect in the page's PARAMETERS) and deferred there as out of scope.", "cause": "`pageToGen` called `SetAutofocus(\"DesktopOnly\")` unconditionally, and both `Forms$Page` and `Forms$Snippet` registered `Variables` in `codec.RegisterTypeDefaults(...).MandatoryLists`, which the encoder emits as an empty typed-array marker for every new element. The page writer had no version awareness at all until #1121 threaded `*types.ProjectVersion` into `pageToGen` for the parameter keys.", "file": "`mdl/backend/modelsdk/page_write.go` (pageSupportsAutofocus/pageSupportsVariables, encodePage, docEncoder), `mdl/backend/modelsdk/snippet_write.go` (encodeSnippet), `modelsdk/codec/encoder.go` (Encoder.OmitKeys). Tests `mdl/backend/modelsdk/page_version_keys_test.go`, `modelsdk/codec/omitkeys_test.go`.", "insight": "**A version-floored key can arrive by two different routes, and only one of them is a gen property.** `Autofocus` is set through gen, so the fix is to not set it; `Variables` exists only because the Studio Pro defaults registry adds it, and a gen `PartList` has no 'present but empty' state — so there is nothing to leave unset and the suppression has to happen in the encoder. That registry is global and keyed by `$Type` alone, so it cannot see a project version: hence `Encoder.OmitKeys`, per-encode. **Suppressing a key and dropping data are different things**: the empty `Variables` marker is safe to suppress, but variables the script DECLARED are refused instead (guard-don't-drop, ADR-0005) — silently dropping them leaves widgets referencing names that are gone (CE1151) from a statement that reported success. Two measurement traps hit on the way: the first control run died on a pre-existing entity before reaching the page statement, so the page was never rewritten and the unchanged output read as a pass — a control that does not run looks exactly like a control that passes; and ALTER PAGE turned out to be safe without any change, because the page mutator edits the stored raw BSON and marshals it back, so it can never invent a key. Check which write paths actually rebuild a document before assuming a header fix has to cover all of them.", "refs": ["#1121"]}
120
120
{"area": "mdl/backend", "date": "2026-09-18", "symptom": "`ALTER PAGE M.P { SET Documentation = '...' }` is refused: \"unsupported page-level property: Documentation\". Documenting an existing page therefore means re-running its CREATE, because the `/** … */` doc comment on the create statement is the only other source", "cause": "`applyPageLevelSetMut` handled Title/Url/Popup*/Class/Style and had no Documentation case. The field was otherwise fully understood — `pageToGen` has always written it on CREATE via `out.SetDocumentation`, and gen binds it as `property.NewPrimitive[string](\"Documentation\")`. The grammar already parsed it (`identifierOrKeyword EQUALS propertyValueV3`) and the executor has no allowlist, so it was one missing case in the mutator, not a syntax gap", "file": "`mdl/backend/pagemutator/mutator.go` (`applyPageLevelSetMut`)", "insight": "One case covers **Page, Layout AND Snippet** — all three declare Documentation and all three reach this function through `SetWidgetProperty(\"\")`. Store an empty string rather than rejecting it: removing a doc comment from a script has to be expressible, and the property is a bare string with no unset value. **Update the unsupported-property message in the same change** — that list is the only guidance a reader gets, and a stale one sends them back to the CREATE workaround the fix exists to remove (a test asserts the message names Documentation). Note the re-run workaround is worse than it sounds: describe → exec is only as complete as what MDL can spell, so restating a page to document it can silently lose widgets", "refs": ["#527"]}
121
121
{"area": "mdl/backend", "date": "2026-09-20", "symptom": "`describe page` → `exec` over a **Studio Pro-authored** page reports `Replaced page`, not `Unchanged` — the rebuild is not semantically equal to what was stored, so ADR-0008's elision cannot fire and the unit churns in version control on every re-run. `mx check` is 0 errors either way. Measured on ako/TestApp Rules.RuleAction_NewEdit at 11.14.0: fourteen differences", "cause": "Four independent classes, all 'the rebuild writes a constant where Studio Pro stores a value': (1) `pageToGen` hardcoded Autofocus/CanvasWidth/CanvasHeight; (2) save_changes/cancel_changes/close_page/delete_object never wrote `DisabledDuringExecution`, and save_changes wrote `SyncAutomatically` true; (3) `AttributeRef.EntityRef` emitted only on the navigated branch; (4) `Forms$PageVariable` had only the one name field set, so the other five keys were never marked dirty", "file": "`mdl/backend/modelsdk/page_write.go` (`carryStoredPageHeader`, `bsonInt`), `widget_write.go` (four action cases + two `RegisterTypeDefaults`), `modelsdk/codec/defaults.go` + `encoder.go` (new `FalseFields`)", "insight": "**mxcli round-tripping its own output proves NOTHING about this class** — measured: the MDL bug-test reports `Unchanged` on the unfixed build too, because mxcli writes the page and mxcli describes it, so its constants agree with themselves. The reference must be a Studio Pro document; a committed CI fixture only works if it is one. **A population selected by name can confirm whatever it excluded**: the first sweep filtered `$Type` on `endswith(\"ClientAction\")`, got a tidy 'True on 82 of 82', and so missed `Forms$NoAction` (False on 83 of ~7,300) and `Forms$MicroflowAction` (5 of 81) — scan by the PROPERTY, not by a name pattern. **Hardcoded looked safe and was not**: CanvasWidth takes seven distinct values across 67 pages and the hardcoded 1200 matched 4, so a round trip moved the canvas of 63. **The int width bit this fix once**: Studio Pro stores both canvas dimensions as int64 while the gen setter takes int32, so the natural `.(int32)` assertion matched nothing — and the first unit test passed anyway because its own fixture wrote int32, i.e. the test encoded the assumption under test (bson-numeric-width). Prefer `TypeDefaults` over patching each construction site: `Forms$PageVariable` is built in three places. Remaining after the fix: 1 of 14, a pluggable-widget Object property — CE0463 territory, deliberately out of scope", "refs": ["#541", "#529"]}
122
+
{"area": "mdl/backend", "date": "2026-09-20", "symptom": "`DROP ENTITY` left every CROSS-MODULE association pointing at the deleted entity in place. Dropping the local BY-ID (FROM) end made mxbuild 11.14.0 unable to LOAD the project: `System.AggregateException \u2026 (The given key '<guid>' was not present in the dictionary.)` at `StreamingBsonUnitReader.ResolvePostponedProperties()` \u2014 no CE code, no document named, so the obvious reading is 'the project is corrupt, restore from git'. Dropping the BY-NAME (TO) end is milder and still wrong: CE1613 at the cross-module association. `show associations` shows a raw GUID where the parent entity should be.", "cause": "`removeAssocsReferencing` swept `dm.AssociationsItems()` and asserted `*genDm.Association` per item, so the SEPARATE `CrossAssociations` collection was never looked at. Fixed with `removeCrossAssocsReferencing`, matching BOTH ends because a cross-module association addresses them differently \u2014 FROM by element id (local), TO by qualified name (another module) \u2014 called in DeleteEntity locally and in its cascade over the other domain models.", "file": "`mdl/backend/modelsdk/domainmodel_alter.go` (removeCrossAssocsReferencing, DeleteEntity)", "insight": "**Reported against a view entity; nothing about it was view-entity specific.** The reporter met it dropping view entities (whose associations are DERIVED from OQL, so there is no CREATE ASSOCIATION to undo) and filed it that way. The first probe \u2014 a view entity and its source entity in the SAME module \u2014 did not reproduce at all, and that negative is the useful one: it says the variable is cross-module, not view-ness. A plain `create association A.X from A.X to B.Y` plus `drop entity A.X` reproduces the identical crash. Two lessons: when a repro fails, vary the dimension the report did not mention before doubting the report, and treat a collection-typed `.(*T)` assertion in a cascade as a place where a sibling type hides. mxbuild's diagnostic distinguishes the two ends for free \u2014 a dangling 16-byte pointer is a LOAD crash, a dangling qualified name is CE1613 \u2014 so testing only one end proves half the fix.", "refs": ["#553", "#556"]}
0 commit comments