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

Function failLatestReconciliation

apps/sim/hooks/use-collaborative-workflow.ts:616–629  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

614 useWorkflowDiffStore.getState().pendingExternalUpdates[workflowId] ?? 0
615 useWorkflowDiffStore.getState().setWorkflowReconciliationInProgress(workflowId, true)
616 const failLatestReconciliation = (message: string) => {
617 if (!isLatestReload()) return
618 const diffStore = useWorkflowDiffStore.getState()
619 if ((diffStore.pendingExternalUpdates[workflowId] ?? 0) <= pendingExternalUpdateAtStart) {
620 diffStore.clearExternalUpdatePending(workflowId)
621 }
622 diffStore.setWorkflowReconciliationInProgress(workflowId, false)
623 diffStore.setWorkflowReconciliationError(workflowId, message)
624 if ((useWorkflowDiffStore.getState().pendingExternalUpdates[workflowId] ?? 0) > 0) {
625 window.dispatchEvent(
626 new CustomEvent(WORKFLOW_DIFF_SETTLED_EVENT, { detail: { workflowId } })
627 )
628 }
629 }
630 // The contract's `state` is `workflowStateSchema` (loose at the wire
631 // level — `subBlocks.value` is `unknown`, optional flags omitted),
632 // but downstream consumers (replaceWorkflowState, the undo/redo

Callers 1

reloadWorkflowFromApiFunction · 0.85

Calls 1

isLatestReloadFunction · 0.85

Tested by

no test coverage detected