Repository navigation
Keep what MDL cannot state on a flow rebuild (drop + create in one script) - #2214
Merged
Merged
Conversation
…ript) A drop + create of a flow in one script is reconciled with the deleted unit, so every element $ID was kept, but the content came from the statement: Mark as used, parameter, activity, loop and decision documentation, a loop's error handling (Continue -> Rollback) and a REST call's proxy came back at the writer's defaults (#2178, mendixlabs#1831). CarryUnexpressed now puts the stored value back on the element of the same $ID for those properties, only while the written value is the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82rmxc4mZcUDT8ePYWM
ako
marked this pull request as ready for review
November 13, 2026 08:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2178 (upstream mendixlabs#1831).
Symptom (as reported)
drop microflow if exists X;followed by the describe of X ascreate, in one script, keeps every element ID. But bson dump shows:MarkAsUsedtruefalseDocumentationParameter documentationDocumentationActivity documentationErrorHandlingType(upstream comment)ContinueRollbackThe last row changes behaviour: one failing iteration now aborts the whole loop.
Cause
The writer remembers a deleted unit's bytes and reconciles the re-insert with them, so
canon.Reconciletransplants the stored$IDs. The content still comes from the statement, though, and none of these properties has an MDL spelling, so the writer's defaults were written.Fix
canon.CarryUnexpressed(run byReconcileafter the transplant) now has a table,unstatedFlowDefaults. Each entry is an element$Typeand key, with the writer's default:MarkAsUsedDocumentationon parameters, action activities, loops, and exclusive and inheritance splitsErrorHandlingTypeRequestProxyTypeandProxyConfigurationThe stored value goes back on the element with the same
$ID, but only while the written value is the default, so a value a statement can state still lands. A carried sub-element whose ID is already in the document is skipped.The fix sits in
Reconcilebecause that is where the identities already survive. It covers both rebuild shapes (drop+createin one script, and acreate or modifythat cannot splice) without pairing activities by hand. LoopCaptionwas a candidate but is not storable, so it isn't in the table.Evidence
TestUnexpressed_FlowRebuildKeepsWhatMDLCannotStatefailed with exactly the reported values (MarkAsUsed:false,Documentation:"",ErrorHandlingType:"Rollback",RequestProxyType:"DefaultProxy").Abort) is not overwritten.mx checkon that patched baseline gives 0 errors. Then I ran drop plus describe output in one script:MarkAsUsed: false, all documentation empty, noContinue.mx checkgives 0 errors.Checks
make build && make test && make lint && make check-mdlpass locally.mdl-examples/bug-tests/2178-drop-create-keeps-unstatable-properties.mdlmake check-findingspasses.alter-microflow.mdand the write-microflows pitfalls page say what a rebuild keeps, and that a create in a later run than its drop still writes the defaults.rewrite-drops-unauthored-statepattern page is synced.Generated by Claude Code