Skip to content

Commit cd74c3e

Browse files
authored
fix(core, editor): prevent overlapping runData and pinData (n8n-io#4323)
🐛 Prevent overlapping `runData` and `pinData`
1 parent 2d4202d commit cd74c3e

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

packages/core/src/WorkflowExecute.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,19 @@ export class WorkflowExecute {
188188
for (let inputIndex = 0; inputIndex < connections.length; inputIndex++) {
189189
connection = connections[inputIndex];
190190

191-
if (workflow.getNode(connection.node)?.disabled) continue;
191+
const node = workflow.getNode(connection.node);
192+
193+
if (node?.disabled) continue;
194+
195+
if (node && pinData && pinData[node.name]) {
196+
incomingData.push(pinData[node.name]);
197+
} else {
198+
incomingData.push(
199+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
200+
runData[connection.node][runIndex].data![connection.type][connection.index]!,
201+
);
202+
}
192203

193-
incomingData.push(
194-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
195-
runData[connection.node][runIndex].data![connection.type][connection.index]!,
196-
);
197204
incomingSourceData.main.push({
198205
previousNode: connection.node,
199206
});

packages/editor-ui/src/components/RunData.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,10 @@ export default mixins(
959959
return option + this.$locale.baseText('ndv.output.of') + (this.maxRunIndex+1) + itemsLabel;
960960
},
961961
getDataCount(runIndex: number, outputIndex: number) {
962+
if (this.pinData) {
963+
return this.pinData.length;
964+
}
965+
962966
if (this.node === null) {
963967
return 0;
964968
}

packages/editor-ui/src/views/NodeView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,10 @@ export default mixins(
22342234
});
22352235
},
22362236
onNodeRun({ name, data, waiting }: { name: string, data: ITaskData[] | null, waiting: boolean }) {
2237+
const pinData = this.$store.getters.pinData;
2238+
2239+
if (pinData && pinData[name]) return;
2240+
22372241
const sourceNodeName = name;
22382242
const sourceNode = this.$store.getters.getNodeByName(sourceNodeName);
22392243
const sourceId = sourceNode.id;

0 commit comments

Comments
 (0)