Skip to content

Commit

Permalink
fix(core): Fix missing successful items on continueErrorOutput with m…
Browse files Browse the repository at this point in the history
…ultiple outputs (#10218)
  • Loading branch information
jeanpaul authored and cstuncsik committed Aug 1, 2024
1 parent 9c7c265 commit a981cda
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 155 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/WorkflowExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,6 @@ export class WorkflowExecute {
);

const errorItems: INodeExecutionData[] = [];
const successItems: INodeExecutionData[] = [];
const closeFunctions: CloseFunction[] = [];
// Create a WorkflowDataProxy instance that we can get the data of the
// item which did error
Expand All @@ -1150,8 +1149,10 @@ export class WorkflowExecute {
outputIndex < mainOutputTypes.length - 1;
outputIndex++
) {
successItems.length = 0;
const items = nodeSuccessData.length ? nodeSuccessData[0] : [];
const successItems: INodeExecutionData[] = [];
const items = nodeSuccessData[outputIndex]?.length
? nodeSuccessData[outputIndex]
: [];

while (items.length) {
const item = items.pop();
Expand Down
5 changes: 4 additions & 1 deletion packages/core/test/WorkflowExecute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ describe('WorkflowExecute', () => {
if (nodeData.data === undefined) {
return null;
}
return nodeData.data.main[0]!.map((entry) => entry.json);
const toMap = testData.output.testAllOutputs
? nodeData.data.main
: [nodeData.data.main[0]!];
return toMap.map((data) => data!.map((entry) => entry.json));
});

// expect(resultData).toEqual(testData.output.nodeData[nodeName]);
Expand Down
Loading

0 comments on commit a981cda

Please sign in to comment.