Skip to content

4220 Remove empty arrays and maps from workflow node parameters before saving#4231

Open
ivicac wants to merge 3 commits intomasterfrom
4220
Open

4220 Remove empty arrays and maps from workflow node parameters before saving#4231
ivicac wants to merge 3 commits intomasterfrom
4220

Conversation

@ivicac
Copy link
Contributor

@ivicac ivicac commented Feb 18, 2026

Empty collections ([] and {}) were persisting in the workflow definition
when parameters were deleted or never configured, causing them to appear
in both the workflow editor and action perform method.

  • Add removeEmptyCollections() that recursively strips empty maps/lists
    from the parameter map before persisting the workflow definition
  • Make removeParameter() self-cleaning by cascading empty-map removal
    through its existing recursion
  • Called in all four save paths: delete/update for both workflow nodes
    and cluster elements

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

ivicac and others added 3 commits February 17, 2026 23:37
…p cleanup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e saving

Empty collections ([] and {}) were persisting in the workflow definition
when parameters were deleted or never configured, causing them to appear
in both the workflow editor and action perform method.

- Add removeEmptyCollections() that recursively strips empty maps/lists
  from the parameter map before persisting the workflow definition
- Make removeParameter() self-cleaning by cascading empty-map removal
  through its existing recursion
- Called in all four save paths: delete/update for both workflow nodes
  and cluster elements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eEmptyCollections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents empty maps/lists ({} / []) from being persisted in workflow node (and cluster element) parameter maps by stripping empty collections before saving workflow definitions, so deleted/unconfigured parameters don’t reappear in the editor or action execution.

Changes:

  • Added removeEmptyCollections() and invoked it in all update/delete save paths (workflow nodes + cluster elements).
  • Enhanced removeParameter() to cascade-remove now-empty parent maps during its recursion.
  • Extended/adjusted facade tests to cover empty-collection cleanup scenarios.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.../WorkflowNodeParameterFacadeTest.java Adds tests verifying empty parent maps/lists are removed after parameter deletion and that non-empty collections are preserved.
.../WorkflowNodeParameterFacadeImpl.java Adds removeEmptyCollections() and calls it before persisting; updates removeParameter() to remove empty parent maps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: empty arrays and maps are showing in perform and workflow editor

2 participants

Comments