Skip to content

Commit 5a88bf2

Browse files
committed
fix: Ensure no running node when execution finished
1 parent d57a180 commit 5a88bf2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/frontend/editor-ui/src/composables/usePushConnection/handlers/executionFinished.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {
2121
ExpressionError,
2222
IDataObject,
2323
IRunExecutionData,
24+
IRunData,
2425
} from 'n8n-workflow';
2526
import { codeNodeEditorEventBus, globalLinkActionsEventBus } from '@/event-bus';
2627
import { h } from 'vue';
@@ -466,6 +467,8 @@ export function setRunExecutionData(
466467
runExecutionData.resultData.runData = workflowsStore.getWorkflowRunData;
467468
}
468469

470+
removeRunningTaskData(runExecutionData.resultData.runData);
471+
469472
workflowsStore.executingNode.length = 0;
470473

471474
workflowsStore.setWorkflowExecutionData({
@@ -505,3 +508,11 @@ export function setRunExecutionData(
505508
const lineNumber = runExecutionData.resultData?.error?.lineNumber;
506509
codeNodeEditorEventBus.emit('highlightLine', lineNumber ?? 'last');
507510
}
511+
512+
function removeRunningTaskData(runData: IRunData): void {
513+
for (const [nodeName, taskItems] of Object.entries(runData)) {
514+
if (taskItems.some((item) => item.executionStatus === 'running')) {
515+
runData[nodeName] = taskItems.filter((item) => item.executionStatus !== 'running');
516+
}
517+
}
518+
}

0 commit comments

Comments
 (0)