fix: CREATE ODATA CLIENT strips uppercase MICROFLOW keyword prefix (#573)#586
Conversation
Closes #573. Visitor emits "MICROFLOW Module.Name" (uppercase) for `microflow X.Y` property values, but extractMicroflowRef only stripped lowercase "microflow ", so the prefix survived into BSON. Mendix then tried to resolve a microflow whose qualified name was literally "MICROFLOW Module.Name" and failed — matching the user-reported error. Fix is a case-insensitive prefix strip in extractMicroflowRef. Same code path serves CREATE, CREATE OR MODIFY, and ALTER ODATA CLIENT. Tests: - TestCreateODataClient_StripsMicroflowPrefix_Issue573 — direct executor test against the proximate failure point. - TestCreateODataClient_VisitorRoundtrip_Issue573 — full MDL → visitor → executor pipeline with the user's exact syntax. - mdl-examples/bug-tests/573-odata-microflow-prefix.mdl — reproduction script for Studio Pro validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove. The PR correctly fixes the issue with comprehensive test coverage, minimal code changes, and appropriate documentation updates. No changes needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove. The PR correctly fixes the bug with minimal, focused changes, includes appropriate test coverage at multiple levels, updates preventive documentation, and maintains all project quality standards. The fix resolves the exact issue where Mendix was trying to resolve microflows with literal "MICROFLOW " prefixes in their names. All checks pass and the solution aligns with the project's architecture and contribution guidelines. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Fixes #573.
Summary
extractMicroflowRefnow strips themicroflowkeyword prefix case-insensitively. The visitor atmdl/visitor/visitor_odata.go:269emits uppercase"MICROFLOW " + qnformicroflow Module.Nameproperty values, but the executor was only trimming lowercase, so the keyword survived into BSON. Mendix then tried to resolve a microflow whose qualified name was literally"MICROFLOW Module.Name"and failed — exactly the error in the issue screenshot..claude/skills/fix-issue.mdso the next visitor-emits-uppercase-but-executor-strips-lowercase mismatch gets caught immediately.Scope
The same
extractMicroflowRefhelper serves three OData-client codepaths:CREATE ODATA CLIENT(cmd_odata.go:1001-1002)CREATE OR MODIFY ODATA CLIENTupdate path (cmd_odata.go:913, 916)ALTER ODATA CLIENT SET …(cmd_odata.go:1152, 1154)All three are fixed by the one-line change.
Test plan
TestCreateODataClient_StripsMicroflowPrefix_Issue573— direct executor test against the proximate failure point.TestCreateODataClient_VisitorRoundtrip_Issue573— full MDL → visitor → executor pipeline using the user's exact syntax.main, pass with this change.mdl-examples/bug-tests/573-odata-microflow-prefix.mdl— reproduction script that passesmxcli check; ready to run throughmxcli execagainst a real project and Studio Pro for confirmation.make testpasses.make lintpasses.🤖 Generated with Claude Code