(workflowId: string, reason: string)
| 747 | } |
| 748 | |
| 749 | const replayPendingExternalUpdate = async (workflowId: string, reason: string) => { |
| 750 | const diffStore = useWorkflowDiffStore.getState() |
| 751 | if ( |
| 752 | useWorkflowRegistry.getState().activeWorkflowId !== workflowId || |
| 753 | diffStore.hasActiveDiff || |
| 754 | diffStore.reconcilingWorkflows[workflowId] || |
| 755 | !diffStore.pendingExternalUpdates[workflowId] |
| 756 | ) { |
| 757 | return |
| 758 | } |
| 759 | |
| 760 | const queueStore = useOperationQueueStore.getState() |
| 761 | if (queueStore.hasPendingOperations(workflowId)) { |
| 762 | return |
| 763 | } |
| 764 | |
| 765 | try { |
| 766 | await reloadWorkflowFromApi(workflowId, reason) |
| 767 | } catch (error) { |
| 768 | logger.error(`Error reloading workflow state after ${reason}:`, error) |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | const handleWorkflowReverted = async (data: any) => { |
| 773 | const { workflowId } = data |
no test coverage detected