Repository navigation
feat(lint): CONV020 — object created in a microflow and never committed, returned or passed on (mendixlabs/mxcli#1518) - #1532
Merged
Conversation
…d on (mendixlabs#1518) An object created with commit = No exists only in memory. If the microflow never commits it, returns it or hands it to anything that could, it is discarded when the microflow ends - and check, mx check and the build are all silent. In the field an after-startup seed microflow logged "Seeded 20" and the table had 0 rows. CONV020 (warning, category quality) walks each microflow's stored object graph via FullMicroflow, like CONV011. It reports a CreateObjectAction with an explicit Commit = No whose entity the catalog lists as persistent, when nothing else in the flow uses the output variable except to read a member ($o/Attr) or change it without commit. Every other mention counts as passing the object on: the walker scans every string of every object in the flow (loops and error-handler paths included) by reflection, so a field holding the variable name (commit, delete, rollback, page passed object, workflow context, export mapping source, ...) or a bare $o in any expression (return value, call arguments, list change, association value) keeps the rule quiet, including action types the rule does not know. It is flow-insensitive on purpose: a commit on one branch only is an accepted false negative. Nanoflows, rules, non-persistent entities, an unstored commit value and System/Marketplace modules are out of scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3x8Fyvir8kLyPgJs1BDmF
ako
pushed a commit
that referenced
this pull request
Oct 21, 2026
Resolve the CHANGELOG conflict with #1532 (CONV020) by keeping both "Added" entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3x8Fyvir8kLyPgJs1BDmF
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.
Implements mendixlabs#1518 (#1400), approved by the maintainer. This is a conservative rule at warning severity.
Rule: CONV020 (quality, warning)
CONV020 sits in
mdl/linter/rules/conv_created_never_persisted.go. It flags a create when all of these hold:CreateObjectActionwith Commit stored explicitly as No;It walks the stored object graph (
FullMicroflow, like CONV011).Escapes. These are flow-insensitive, include loops and error handlers, and match whole words regardless of case. Any of the following keeps the rule quiet:
$oin an expression.Only reading a member (
$o/Attr) or changing the object without commit does not count as a use, so an unknown action type also keeps it quiet. A commit on only one branch is an accepted false negative.Tests
conv_created_never_persisted_test.go, 34 subtests:Revert check:
End to end: on an 11.15 fixture copy,
mdl-examples/bug-tests/1518-created-object-never-persisted.mdlgives exactly one CONV020. The controls stay silent, andmx checkreports 0 errors, so nothing else catches this.False-positive survey
mdl-examplesscripts containingcreatewere executed into fresh fixture copies, then linted. That gave 70 creates with commit No and 7 hits, all read and all true positives: test fixtures whose object really is dropped.Accountis passed on as an association value.Docs: the
docs-site/src/tools/builtin-rules.mdrule row and a details section,linting.md, themendix/lintcommand table, the assess-quality skill, and a CHANGELOG entry.make build,make testandmake lintpass.For review
mxcli checkversion of the rule, the wayvalidate_commit_in_loop.gomirrors CONV011. That could be a follow-up.Generated by Claude Code