Pre-batch stamp: write each targeted cell as `pending` (no executionId) * before firing the batch so the renderer shows the cell as in-flight * immediately. The cell-task overwrites with `running` (and its own * executionId) once it acquires the row's cascade lock — if another * cell-task al
(pendingRuns: WorkflowGroupCellPayload[])
| 685 | * cell-task already holds the lock, this task bails and the pending stamp |
| 686 | * is later reconciled by whoever owns the cascade. */ |
| 687 | async function stampQueuedForBatch(pendingRuns: WorkflowGroupCellPayload[]): Promise<void> { |
| 688 | await Promise.allSettled( |
| 689 | pendingRuns.map((runOpts) => |
| 690 | writeWorkflowGroupState(runOpts, { |
| 691 | executionState: { |
| 692 | status: 'pending', |
| 693 | executionId: null, |
| 694 | jobId: null, |
| 695 | workflowId: runOpts.workflowId, |
| 696 | error: null, |
| 697 | }, |
| 698 | }) |
| 699 | ) |
| 700 | ) |
| 701 | } |
| 702 | |
| 703 | async function advanceCursor(dispatchId: string, newCursor: number): Promise<void> { |
| 704 | await db |
no test coverage detected