Summary
LIST FOLDERS does not count JSON structures as folder members, so a folder that holds them reports [0]. DROP FOLDER then deletes them along with the folder. The listing that a script would use to decide "this folder is empty, it can go" is the one that cannot see the documents it is about to destroy.
Environment
- mxcli v0.17.0, windows/amd64
- Studio Pro 11.12.2, MPR format v2
What happened
A module had a Studio Pro-created folder JSON structures containing 7 JSON structures, each bound to an import mapping.
mxcli -p app.mpr -c "LIST FOLDERS MyModule"
...
JSON structures [0]
Based on that count the folder was dropped:
DROP FOLDER MyModule.'JSON structures';
The folder and all 7 structures were gone, and every bound mapping went to CE1613 ("... no longer exists") on the next Studio Pro open. Recovery was only possible because the MDL sources that had created the structures still existed.
Verifiable without Studio Pro (v0.17.0)
The listing gap is not a display detail; mxcli has no folder-awareness for this document type at all:
CREATE JSON STRUCTURE MyModule.ZZ_Probe FOLDER 'ZZProbe' SNIPPET '{"id": 1}';
-- Parse error: line 1:71 mismatched input 'FROM' expecting {SNIPPET, COMMENT}
-- (no FOLDER clause exists on CREATE JSON STRUCTURE)
MOVE JSON STRUCTURE MyModule.ZZ_Probe TO 'ZZProbe';
-- Parse error: no viable alternative at input 'MOVEJSON'
-- (MOVE does not accept JSON STRUCTURE)
So a JSON structure can only be placed in a folder from Studio Pro, mxcli cannot see it there, and mxcli will still delete it with the folder.
Expected
Either of these would have prevented the loss:
LIST FOLDERS counts and lists every document type a folder can contain (at minimum: whatever DROP FOLDER is capable of deleting).
DROP FOLDER refuses, or requires an explicit CASCADE, when the folder contains documents of types the listing cannot enumerate.
Also worth considering: FOLDER / MOVE support for JSON structures and mappings, so the folder structure a team maintains in Studio Pro is reachable from scripts at all.
Impact
Silent, unrecoverable document loss from a command whose own diagnostics said the folder was empty. The failure only surfaces later as CE1613 on every mapping that used the structures.
Context: found while cleaning up after building a complete Odoo connector end to end with mxcli.
Summary
LIST FOLDERSdoes not count JSON structures as folder members, so a folder that holds them reports[0].DROP FOLDERthen deletes them along with the folder. The listing that a script would use to decide "this folder is empty, it can go" is the one that cannot see the documents it is about to destroy.Environment
What happened
A module had a Studio Pro-created folder
JSON structurescontaining 7 JSON structures, each bound to an import mapping.Based on that count the folder was dropped:
The folder and all 7 structures were gone, and every bound mapping went to CE1613 ("... no longer exists") on the next Studio Pro open. Recovery was only possible because the MDL sources that had created the structures still existed.
Verifiable without Studio Pro (v0.17.0)
The listing gap is not a display detail; mxcli has no folder-awareness for this document type at all:
So a JSON structure can only be placed in a folder from Studio Pro, mxcli cannot see it there, and mxcli will still delete it with the folder.
Expected
Either of these would have prevented the loss:
LIST FOLDERScounts and lists every document type a folder can contain (at minimum: whateverDROP FOLDERis capable of deleting).DROP FOLDERrefuses, or requires an explicitCASCADE, when the folder contains documents of types the listing cannot enumerate.Also worth considering:
FOLDER/MOVEsupport for JSON structures and mappings, so the folder structure a team maintains in Studio Pro is reachable from scripts at all.Impact
Silent, unrecoverable document loss from a command whose own diagnostics said the folder was empty. The failure only surfaces later as CE1613 on every mapping that used the structures.
Context: found while cleaning up after building a complete Odoo connector end to end with mxcli.