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

Function completeDispatch

apps/sim/lib/table/dispatcher.ts:666–679  ·  view source on GitHub ↗

Mark a dispatch complete and emit the terminal SSE so the client overlay * clears. Shared by the row-cap exhaustion path.

(dispatch: DispatchRow, cursor: number)

Source from the content-addressed store, hash-verified

664/** Mark a dispatch complete and emit the terminal SSE so the client overlay
665 * clears. Shared by the row-cap exhaustion path. */
666async function completeDispatch(dispatch: DispatchRow, cursor: number): Promise<void> {
667 await markDispatchComplete(dispatch.id)
668 await appendTableEvent({
669 kind: 'dispatch',
670 tableId: dispatch.tableId,
671 dispatchId: dispatch.id,
672 status: 'complete',
673 scope: dispatch.scope,
674 cursor,
675 mode: dispatch.mode,
676 isManualRun: dispatch.isManualRun,
677 ...(dispatch.limit ? { limit: dispatch.limit } : {}),
678 })
679}
680
681/** Pre-batch stamp: write each targeted cell as `pending` (no executionId)
682 * before firing the batch so the renderer shows the cell as in-flight

Callers 1

dispatcherStepFunction · 0.85

Calls 2

appendTableEventFunction · 0.90
markDispatchCompleteFunction · 0.85

Tested by

no test coverage detected