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)
| 664 | /** Mark a dispatch complete and emit the terminal SSE so the client overlay |
| 665 | * clears. Shared by the row-cap exhaustion path. */ |
| 666 | async 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 |
no test coverage detected