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
Copy file name to clipboardExpand all lines: .claude/skills/debug-bson.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Use when encountering:
9
9
-**Studio Pro crash on open** with `RevStatusCache.CreateDeleteStatusItem` in stack trace
10
10
-**`mx diff` crash** with "Sequence contains no matching element"
11
11
-**CE1613** "The selected attribute/enumeration no longer exists"
12
+
-**CE0115** "The arguments that are passed to page X do not match the expected parameters"
12
13
-**CE0463** "The definition of this widget has changed"
13
14
-**CE0642** "Property X is required"
14
15
-**CE0091** validation errors on widget properties
@@ -306,6 +307,51 @@ for t, props in crash_props.items():
306
307
307
308
**Fix**: Extract a fresh template from a project with `mx update-widgets` applied. The Type section must match the installed widget version exactly.
308
309
310
+
### CE0115: Arguments Passed to Page Do Not Match Expected Parameters
311
+
312
+
**Symptom**: `mx check` reports `[CE0115] "The arguments that are passed to page 'X' do not match the expected parameters."` on an action button that uses `show_page TargetPage (Param: $currentObject)`.
313
+
314
+
**Root cause**: The BSON array type indicator rule. Every Mendix BSON array must begin with an `int32`**type indicator** of `2` or `3`. This indicator is skipped by `extractBsonArray` and by Studio Pro's reader. Writing `int32(len(items))` as the first element instead produces an invalid indicator when `len ≠ 2` and `len ≠ 3` — Studio Pro cannot recognise the array and reads 0 parameter mappings.
315
+
316
+
**Type indicator values**:
317
+
| First element | Meaning |
318
+
|---------------|---------|
319
+
|`int32(3)`| Initialized array — used for `Items`, `DesignProperties`, and most non-empty lists |
320
+
|`int32(2)`| Initialized empty array — used for `ParameterMappings`, `PagesForSpecializations`, `Parameters`|
321
+
| Any other value |**Invalid** — Studio Pro ignores the entire array |
322
+
323
+
**How Studio Pro stores page parameter mappings**: Studio Pro does **not** store explicit `Forms$PageParameterMapping` objects in BSON. It always writes `ParameterMappings: [2]` (type indicator only, no inline objects) and infers `$currentObject` at runtime from the enclosing widget context — DataGrid row, DataView datasource, etc. No matter what the MDL source specifies for `(Param: $currentObject)`, the correct serialization is always the empty `[2]` array.
324
+
325
+
**Correct writer pattern for `Forms$FormAction`**:
**Diagnostic check**: Inspect the raw `ParameterMappings` array in a Python BSON dump. If it shows `[1, {...}]` instead of `[2]`, the type indicator is wrong. Studio Pro-generated pages always show `[2]`.
354
+
309
355
## Key Principles
310
356
311
357
1.**Template cloning > building from scratch**: Clone properties from a known-good template Object, then modify only specific values. Building from scratch produces subtly different structures.
0 commit comments