Skip to content

Commit

Permalink
fix(core, editor): prevent overlapping runData and pinData (#4323)
Browse files Browse the repository at this point in the history
🐛 Prevent overlapping `runData` and `pinData`
  • Loading branch information
ivov authored Oct 12, 2022
1 parent 2d4202d commit cd74c3e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/core/src/WorkflowExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
4 changes: 4 additions & 0 deletions packages/editor-ui/src/components/RunData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cd74c3e

Please sign in to comment.