|
660 | 660 | {"area":"mdl/executor","date":"2026-09-20","symptom":"`CREATE OR MODIFY EXTERNAL ENTITIES FROM` marks NON-KEY attributes of a top-level external entity Updatable=true when the entity set's UpdateRestrictions say the set is updatable. `mx check` reports one CE6630 per attribute: \"'Label' is marked Updatable=False in the OData service, but True in the app.\" The sibling of the key-attribute defect fixed the same day; fixing only the key took the reported repro from 2 errors to 1, not to 0","cause":"`createExternalEntities` derived `defaultUpdatable` from `entitySet.Updatable`. Mendix does not: it computes Updatable as a function of whether the entity has an entity set at all — never for a top-level entity, always for a non-top-level one, which is written through its parent's flow. The annotation is irrelevant to it","file":"`mdl/executor/cmd_contract.go` (`defaultUpdatable := !isTopLevel`, replacing the UpdateRestrictions override; the key-specific guard added earlier becomes subsumed)","insight":"**The positive control that closes this is a contract whose `NonUpdatableProperties` names ONLY the key.** That service is asserting, by name, that every other property IS updatable — and mxbuild still answers False. Ten top-level shapes were probed in three rounds and all answered False (inline record, typed `<Record Type=…>`, UpdateMethod=PATCH, +NonUpdatableProperties +DeleteRestrictions, unannotated, external `<Annotations Target=…>`, Core.Permissions/ReadWrite, Core.OptimisticConcurrency/ETag, DeepUpdateSupport, and the key-only exclusion list); the first seven were NOT enough to act on, because 'no shape produces True' is the uniform-negative shape that means the probe is wrong — what made it actionable was a shape that states the opposite explicitly and is still refused. **Two false leads, each cheap and each worth skipping.** (1) ETag/optimistic concurrency, suggested by a comment in this very function about the service that motivated #729 — no effect. (2) The model's `AllowCreateChangeLocally`: the intuition is that Mendix would permit attribute changes once local changes are allowed, and it is wrong — setting it Yes on a top-level entity left the expectation at False. **That second control is the one that explains the rule rather than just fitting it**: an external object CAN be changed in memory and handed to an external OData action, and that is what the local-change flag governs; the attribute's `Updatable` mirrors only what the endpoint itself accepts on a PATCH. Domain knowledge from the maintainer, not derivable from the metamodel — worth asking for before probing an eleventh contract shape. The Insert/Update asymmetry that makes this look like a parser bug is real and is not one: mxbuild reads `InsertRestrictions` from the same document, in the same shapes, and honours it — so `Creatable` follows the contract and `Updatable` does not, which is also why 'the entity is read-only' is the wrong summary and why every test here asserts Creatable as its control. **A stale test encoded the old belief and had to be corrected, not worked around**: #1118's `TestCreateExternalEntities_FlattenedAttributesAreReadOnly` asserted `Label` was Creatable AND Updatable as its control; the Updatable half had been assumed from the contract rather than measured, while the flattened-attribute half it was controlling for HAD been. The control still works on Creatable alone. Verified end to end on a real 11.12.1 project: 2 errors before any fix, 1 after the key-only fix, **0 errors** now; TripPin (`-run 'TestMxCheck_DoctypeScripts/10-odata-examples'`, ~26s locally) is the other-direction control and stays green, since every entity it flags is non-top-level. Repro `mdl-examples/bug-tests/odata-key-attribute-updatable.mdl`; tests `mdl/executor/cmd_contract_key_updatable_test.go`","file_refs":["mdl/executor/cmd_contract.go"],"ce":["CE6630"]} |
661 | 661 | {"area":"mdl/linter","date":"2026-09-20","symptom":"mxcli happily authors `staticimage`/`dynamicimage` with nothing warning the author, and #518/#538 had just made both MORE capable (Image:, DataSource:, DefaultImage:, thumbnail, enlarge all newly reachable). The only signal that these widgets do not work was CE0582 at the far end of a build. Separately, three places in code comments and user-facing help claimed the deprecation was 'Mendix 11's React client'","cause":"Two things. (1) No validator or lint rule mentioned either widget (measured: `grep -rln deprecat mdl/executor/validate*.go` matched only an unrelated test), so the deprecation lived entirely in prose. (2) The version claim was inherited from a pre-existing comment and repeated without checking the doc: docs.mendix.com/refguide/image-viewer/ says the React client was added in **10.7**, so CE0582 fires on 10.7+ wherever that client is enabled, not only on 11","file":"`mdl/linter/rules/legacy_image_widget.go` (new, MPR012) + registration in `mdl/executor/cmd_lint.go` (x2) and `cmd/mxcli/cmd_lint.go`; wording in `mdl/backend/modelsdk/widget_write_legacy_gaps.go`, `.claude/skills/mendix/create-page/reference/widgets.md`, `cmd/mxcli/syntax/features_page.go`; table row in `.claude/commands/mendix/lint.md`","insight":"**A deprecation warning belongs in `lint`, not in `check`.** `check` validates a script, and `describe page` -> `exec` of a legacy page is a legitimate lossless operation — a check warning would fire on correct work every time, which is the noise trap MDL-WIDGET23's own history records. `lint` audits the project, where 'this page holds a widget your client cannot render' is wanted once. **The marketplace exclusion came free and is the control worth measuring**: `ctx.Widgets()` filters any module with a Source (notPlatformModule), so the rule never fires on the Studio Pro static images a blank app inherits from FeedbackModule — content the reader cannot fix and an update would replace. Measured: 8 legacy image widgets in the project, 7 indexed by the catalog, 5 in the user's own module, and lint reported exactly those 5. **A deny-list of two, never an allow-list**: the one widget such a rule must never fire on is the pluggable Image, i.e. the replacement it recommends. **'Deprecated in version X' needs the vendor doc, not the previous comment** — this repo had carried 'Mendix 11' for as long as the widgets had been written, and one fetch of the reference guide moved it to 10.7. A version boundary copied from a sibling comment is the same class of error as a floor copied from a proposal's sample output (mendixlabs/mxcli#1121)","refs":["mendixlabs/mxcli#1057"],"ce":["CE0582"],"rules":["MPR012"]} |
662 | 662 | {"area": "mdl/backend/pagemutator", "date": "2026-09-20", "symptom": "`alter page … { set DataSource = DATABASE Mod.Entity on dvCust; }` passes `check`, prints `Altered page …` with exit 0, and leaves the DataView with no datasource: `describe page` renders `dataview dvCust {` with the property gone, and the only other signal is CE7007 at `mx check`", "cause": "`serializeDataSourceBson` mapped every `*pages.DatabaseSource` to a `Forms$DataViewSource` — the *context* source — with the entity in `EntityRef` and `SourceVariable` left null. A DATABASE source has no single stored shape: the widget holding it decides (`Forms$ListViewXPathSource` on a list view, `CustomWidgets$CustomWidgetXPathSource` on a pluggable widget, `Forms$GridXPathSource` on a grid), and a DATA VIEW has no database form at all — which is why CREATE PAGE's `dataViewSourceToGen` already refused that pairing while SET wrote it silently", "file": "`mdl/backend/pagemutator/mutator.go` (`SetWidgetDataSource`, new `databaseSourceRefusal`, `serializeDataSourceBson`)", "insight": "**The \"gone entirely\" in the report was DESCRIBE, not the document.** The DataSource was present and well-formed BSON; `parseContextSource` returns nil for a `Forms$DataViewSource` with no `SourceVariable`, so the reader rendered nothing. Chasing a deleted property would have been the wrong hunt — diff the stored BSON before believing a describe-shaped symptom. **The refusal belongs in the mutator, not the validator**: `validateAlterSetProperties` dry-runs the real setter against a `pagemutator.Probe()` copy, so one refusal makes `check -p --references` and `exec` agree by construction; a second copy of the rule in the validator is the duplicate-resolver drift CLAUDE.md warns about. **Refusing beat rebuilding the shapes here** — writing ListViewXPathSource in raw BSON would duplicate `listViewSourceToGen` in a second currency, and REPLACE already reaches the real builder. **Two remedies, not one**: on a data view `use REPLACE` is a dead end (CREATE PAGE refuses it too), so the message names the sources a data view can take; on a list view REPLACE genuinely works, so it names REPLACE. Getting that backwards sends the author in a circle. **Same generalisable shape as #855/#1101**: when SET and REPLACE express different vocabularies for one property, SET is a whitelist extended one bug report at a time. **`make check-mdl` runs `mxcli check` WITHOUT `-p`**, so a document-dependent refusal cannot be a `.fail.mdl` — it would be reported as a negative test that unexpectedly passed. Write the passing shape and comment the refused statements, as #1063 does. Measured on two copies of a real 11.13.0 app: faulty → `Check passed!`, exit 0, `mx check` 1 error CE7007 at Data view 'dvCust'; fixed → both refuse with exit 1, datasource unchanged, `mx check` 0 errors. Tests `mdl/backend/pagemutator/mutator_datasource_test.go`, `mdl/executor/validate_alter_set_test.go`; example `mdl-examples/bug-tests/1032-alter-page-set-database-datasource.mdl`. upstream #1032", "refs": ["#855", "#1032"], "ce": ["CE7007"]} |
| 663 | +{"area": "mdl/executor", "date": "2026-09-20", "symptom": "`describe page` → `exec` over a **Studio Pro-authored** page silently drops six things, `mx check` 0 errors throughout. The one that matters: `IsPasswordBox True → False` — a **password field round-trips into a plaintext text box**, and describe → rename → exec is mxcli's copy operation. Also `Validation.Expression` blanked, a DataView's `ReadOnlyStyle Text → Control`, `PopupCloseAction` wiped, and two typed-array markers", "cause": "Four different causes behind one symptom, which is why triage came first: (1) IsPasswordBox — model and writer carried it, nothing parsed it, nothing emitted it; (2) Validation — `widgetValidationToGen()` wrote a DEFAULT EMPTY Forms$WidgetValidation over whatever was stored, on five widget types; (3) ReadOnlyStyle — wired for CheckBox only, and a DataView's draws no MDL-WIDGET07 warning because `staticWidgetKnownProps` is deliberately a union across widget types; (4) PopupCloseAction — `pageToGen` wrote \"\" unconditionally. Plus ParameterMappings/OutputMappings markers", "file": "`mdl/executor/cmd_pages_describe_parse.go` + `_output.go` (extract/emit), `cmd_pages_builder_v3_widgets.go` (consume), `cmd_pages_builder_v3.go`, `mdl/visitor/visitor_page_v3.go`, `mdl/ast/ast_page_v3.go`, `sdk/pages/*`, `mdl/backend/modelsdk/widget_write.go` + `page_write.go`, `mdl/executor/validate_widgets.go` (describe vocabulary)", "insight": "**Triage the layer before writing anything** — describer / grammar / builder have different fixes and this one issue had all three. The quickest probe is to run the property through `mxcli check`: MDL-WIDGET07 names an unrecognised one, and *silence is not acceptance* — the known-props list is a union across widget types, so a DataView's ReadOnlyStyle passed check and was dropped anyway. **Emit an expression QUOTED, not bracketed**: `[...]` is the XPath-constraint spelling and `propertyValueV3` parses it as an ARRAY, so `GetStringProp` yields \"\" — the emitter's own unit test was green while the real round trip still lost the value (storage form is not input form). **Measure the default before keeping it**: a DataView's ReadOnlyStyle is Control on 47 of 56, never Inherit, so the 'obvious' Inherit that every other input widget uses would have been wrong. Markers likewise measured, not assumed: ParameterMappings is marker 2 on 220 of 220 lists in every parent type, OutputMappings present on 91 of 91 — and an EMPTY list needs `MandatoryListMarkers` since `RegisterListMarker` keys on a child that is not there. Result 17 → 9 differences, the 9 being ako/mxcli#549", "refs": ["#550", "#541", "#549", "#490"]} |
0 commit comments