Skip to content

Commit

Permalink
fix(core): Do not remove empty output connections arrays in PurgeInva…
Browse files Browse the repository at this point in the history
…lidWorkflowConnections migration (#5546)

fix(cli): Do not remove empty output connections arrays in PurgeInvalidWorkflowConnections migration
  • Loading branch information
OlegIvaniv authored Feb 22, 2023
1 parent 8d84e68 commit 0fbb3f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
!nodesThatCannotReceiveInput.includes(outgoingConnections.node),
);
});

// Filter out output connection items that are empty
connection[outputConnectionName] = connection[outputConnectionName].filter(
(item) => item.length > 0,
);

// Delete the output connection container if it is empty
if (connection[outputConnectionName].length === 0) {
delete connection[outputConnectionName];
}
});

// Finally delete the source node if it has no output connections
if (Object.keys(connection).length === 0) {
delete connections[sourceNodeName];
}
});

// Update database with new connections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
!nodesThatCannotReceiveInput.includes(outgoingConnections.node),
);
});

// Filter out output connection items that are empty
connection[outputConnectionName] = connection[outputConnectionName].filter(
(item) => item.length > 0,
);

// Delete the output connection container if it is empty
if (connection[outputConnectionName].length === 0) {
delete connection[outputConnectionName];
}
});

// Finally delete the source node if it has no output connections
if (Object.keys(connection).length === 0) {
delete connections[sourceNodeName];
}
});

// Update database with new connections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
!nodesThatCannotReceiveInput.includes(outgoingConnections.node),
);
});

// Filter out output connection items that are empty
connection[outputConnectionName] = connection[outputConnectionName].filter(
(item) => item.length > 0,
);

// Delete the output connection container if it is empty
if (connection[outputConnectionName].length === 0) {
delete connection[outputConnectionName];
}
});

// Finally delete the source node if it has no output connections
if (Object.keys(connection).length === 0) {
delete connections[sourceNodeName];
}
});

// Update database with new connections
Expand Down

0 comments on commit 0fbb3f0

Please sign in to comment.