MCPcopy Index your code
hub / github.com/simstudioai/sim / replayPendingExternalUpdate

Function replayPendingExternalUpdate

apps/sim/hooks/use-collaborative-workflow.ts:749–770  ·  view source on GitHub ↗
(workflowId: string, reason: string)

Source from the content-addressed store, hash-verified

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

Callers 5

reloadWorkflowFromApiFunction · 0.85
handleWorkflowUpdatedFunction · 0.85
handleDiffSettledFunction · 0.85
handleOperationConfirmedFunction · 0.85
useCollaborativeWorkflowFunction · 0.85

Calls 2

reloadWorkflowFromApiFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected