New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(editor): Drop outgoing connections on order changed event for nodes with dynamic outputs #9055
fix(editor): Drop outgoing connections on order changed event for nodes with dynamic outputs #9055
Conversation
…switch-reordering-changes-which-nodes-are-connected-to-which
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also please add a small test to check that nodes are actually disconnected when you change the Swithc node output order? 🙏
@@ -853,6 +857,20 @@ export default defineComponent({ | |||
return; | |||
} | |||
|
|||
if ( | |||
parameterData.type && | |||
SHOULD_CLEAR_NODE_OUTPUTS[nodeType.name] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eslint warning here: Prefer using an optional chain expression instead, as it's more concise and easier to read.eslint[@typescript-eslint/prefer-optional-chain](https://typescript-eslint.io/rules/prefer-optional-chain)
clearNodeOutgoingConnections() { | ||
const uiStore = useUIStore(); | ||
return (nodeName: string): void => { | ||
if (this.workflow.connections.hasOwnProperty(nodeName)) { | ||
this.workflow.connections[nodeName] = {}; | ||
uiStore.stateIsDirty = true; | ||
return; | ||
} | ||
}; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be a getter but rather an action
@@ -1093,6 +1093,8 @@ | |||
"nodeSettings.latest": "Latest", | |||
"nodeSettings.deprecated": "Deprecated", | |||
"nodeSettings.latestVersion": "Latest version: {version}", | |||
"nodeSettings.outputCleared.title": "Parameters changed", | |||
"nodeSettings.outputCleared.message": "Order of parameters changed, outgoing connections was cleared", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of parameters changed, outgoing connections were cleared.
…switch-reordering-changes-which-nodes-are-connected-to-which
…switch-reordering-changes-which-nodes-are-connected-to-which
…switch-reordering-changes-which-nodes-are-connected-to-which
…switch-reordering-changes-which-nodes-are-connected-to-which
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all my points, LGTM!
✅ All Cypress E2E specs passed |
2 flaky tests on run #4625 ↗︎
Details:
cypress/e2e/5-ndv.cy.ts • 2 flaky tests
Review all test suite changes for PR #9055 ↗︎ |
Got released with |
…es with dynamic outputs (#9055)
Summary
Because of Switch outputs are configured dynamically, based on rules, we are disconnecting connected nodes on rules reorder and show a warning in UI
Related tickets and issues
https://linear.app/n8n/issue/NODE-1273/switch-reordering-changes-which-nodes-are-connected-to-which-outputs
https://community.n8n.io/t/reorder-outputs-in-switch-does-not-reorder-output-connections/43302