fix(core, editor): prevent overlapping runData and pinData (#4323)

🐛 Prevent overlapping `runData` and `pinData`
This commit is contained in:
Iván Ovejero 2022-10-12 16:13:59 +02:00 committed by GitHub
parent 2d4202d051
commit cd74c3ebae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View file

@ -188,12 +188,19 @@ export class WorkflowExecute {
for (let inputIndex = 0; inputIndex < connections.length; inputIndex++) {
connection = connections[inputIndex];
if (workflow.getNode(connection.node)?.disabled) continue;
const node = workflow.getNode(connection.node);
if (node?.disabled) continue;
if (node && pinData && pinData[node.name]) {
incomingData.push(pinData[node.name]);
} else {
incomingData.push(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
runData[connection.node][runIndex].data![connection.type][connection.index]!,
);
}
incomingData.push(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
runData[connection.node][runIndex].data![connection.type][connection.index]!,
);
incomingSourceData.main.push({
previousNode: connection.node,
});

View file

@ -959,6 +959,10 @@ export default mixins(
return option + this.$locale.baseText('ndv.output.of') + (this.maxRunIndex+1) + itemsLabel;
},
getDataCount(runIndex: number, outputIndex: number) {
if (this.pinData) {
return this.pinData.length;
}
if (this.node === null) {
return 0;
}

View file

@ -2234,6 +2234,10 @@ export default mixins(
});
},
onNodeRun({ name, data, waiting }: { name: string, data: ITaskData[] | null, waiting: boolean }) {
const pinData = this.$store.getters.pinData;
if (pinData && pinData[name]) return;
const sourceNodeName = name;
const sourceNode = this.$store.getters.getNodeByName(sourceNodeName);
const sourceId = sourceNode.id;