-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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): Prevent creation of input connections for nodes without input slot #5425
fix(editor): Prevent creation of input connections for nodes without input slot #5425
Conversation
@@ -239,6 +239,14 @@ export class Start extends Command { | |||
const { flags } = this.parse(Start); | |||
|
|||
try { | |||
// Load all node and credential types |
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.
We had to move the loading of nodes and credentials up to make sure they are available in the migrations. @netroy Do you see any issues with this?
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 should be fine. I don't foresee any issues.
packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
...ges/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
...ges/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
Another thing we could do is remove the duplicate code off the migration files to a helper function, but this is not urgent. It won't be reused so it's fine. |
packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
...ges/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts
Outdated
Show resolved
Hide resolved
…input slot (#5425) * fix(editor): Prevent creation of input connections for nodes without input * WIP: Workflow checks service and controller * fix: Created SQLite migration to remove broken connections * Cleanup & add mysql/posgres migrations * Linter fixes * Unify the migration scripts * Escape migration workflow_entity * Wrap the migration in try/catch and do not parse nodes and connection if mysql/postgres * Do migration changes also fro mysql * refactor: Wrap only the necessary call in try catch block --------- Co-authored-by: Omar Ajoue <krynble@gmail.com>
…input slot (#5425) * fix(editor): Prevent creation of input connections for nodes without input * WIP: Workflow checks service and controller * fix: Created SQLite migration to remove broken connections * Cleanup & add mysql/posgres migrations * Linter fixes * Unify the migration scripts * Escape migration workflow_entity * Wrap the migration in try/catch and do not parse nodes and connection if mysql/postgres * Do migration changes also fro mysql * refactor: Wrap only the necessary call in try catch block --------- Co-authored-by: Omar Ajoue <krynble@gmail.com>
Got released with |
In the recent changes to
__addConnection
we've changed the previous if/else condition to just if. Doing this, thethis.workflowsStore.addConnection({ connection });
call would always be executed no matter if the connection could be made or not. So when a user would have selected a regular node and added a trigger node, these would be connected even though the trigger node has no inputs.This PR fixes it by removing this call completely since
addVisualConnection
parameter is always sent withtrue
anyway. Without forcingthis.workflowsStore.addConnection
call, the connection will be made only if the target node has a valid input.For already broken workflows, there is migration that will detect corrupted connections and purge them.
Github issue / Community forum post (link here to close automatically): https://community.n8n.io/t/schedule-trigger-node-is-getting-triggered-multiple-times-during-a-workflow/22822