Skip to content

Commit

Permalink
bugifx: stale node output data
Browse files Browse the repository at this point in the history
  • Loading branch information
srijanpatel committed Jan 20, 2025
1 parent 857b2dd commit 6925016
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions frontend/src/hooks/useWorkflowExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,16 @@ export const useWorkflowExecution = ({ onAlert }: UseWorkflowExecutionProps) =>
const output_values = task.outputs || {}
const nodeTaskStatus = task.status
if (node) {
// Check if the task output or status is different from current node data
const isOutputDifferent = JSON.stringify(output_values) !== JSON.stringify(node.data?.run)
const isStatusDifferent = nodeTaskStatus !== node.data?.taskStatus

if (isOutputDifferent || isStatusDifferent) {
dispatch(
updateNodeDataOnly({
id: node.id,
data: {
run: { ...node.data.run, ...output_values },
error: task.error || null,
taskStatus: nodeTaskStatus,
},
})
)
}
dispatch(
updateNodeDataOnly({
id: node.id,
data: {
run: { ...output_values },
error: task.error || null,
taskStatus: nodeTaskStatus,
},
})
)
}
})
}
Expand Down

0 comments on commit 6925016

Please sign in to comment.