Skip to content

Commit 25f46e3

Browse files
committed
fix(terminal): re-read entries inside reconcileFinalBlockLogs loop
For workflows with loop or parallel iterations, finalBlockLogs can contain multiple terminal logs sharing the same blockId. The prior code captured entries once before the loop, so entries.find always matched the same first running entry — later iterations stayed isRunning: true and got swept to "cancelled" instead of showing their actual terminal state. Re-read the snapshot per iteration so each updateConsole's isRunning: false flush narrows the next match.
1 parent 0397fdf commit 25f46e3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ export function reconcileFinalBlockLogs(
454454
finalBlockLogs: BlockLog[] | undefined
455455
): void {
456456
if (!finalBlockLogs?.length || !executionId) return
457-
const entries = useTerminalConsoleStore.getState().getWorkflowEntries(workflowId)
458457
for (const log of finalBlockLogs) {
458+
const entries = useTerminalConsoleStore.getState().getWorkflowEntries(workflowId)
459459
const running = entries.find(
460460
(e) => e.blockId === log.blockId && e.executionId === executionId && e.isRunning
461461
)

0 commit comments

Comments
 (0)