fix(core): Do not remove empty output connections arrays in PurgeInvalidWorkflowConnections migration (#5546)

fix(cli): Do not remove empty output connections arrays in PurgeInvalidWorkflowConnections migration
This commit is contained in:
OlegIvaniv 2023-02-22 14:20:06 +01:00 committed by GitHub
parent 8d84e684cf
commit 0fbb3f0f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 45 deletions

View file

@ -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

View file

@ -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

View file

@ -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