(message: string)
| 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 |
no test coverage detected