Close three races the review found in the flow window

- Replay live changes over a page of older flows, so a slow flow that
  ends while the page loads is not lost from the window.
- Read list_flows' page and total from one snapshot, so a flow written
  between them is not counted twice.
- Commit a clear's flow deletion only after its bodies' deletion, so a
  failure leaves the flows to clear again rather than orphaned bodies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Gregory SchierandClaude Opus 5.5 authored and Stetta task tk_mvsazf4rsaotrdpf committed 2026-10-28 10:04:25 -07:00
1 parent 1a994f7532
commit 39a7397ebb
4 files changed
+121 -76

No files matched your search

+1 -2
View File
@@ -607,8 +607,7 @@ fn list_actions(
}
fn list_flows(ctx: &ProxyCtx, req: flows::FlowFilter) -> Result<ListFlowsResponse, RpcError> {
let flows = flows::list(&ctx.db, &req).map_err(rpc_error)?;
let total = flows::count(&ctx.db).map_err(rpc_error)?;
let (flows, total) = flows::page(&ctx.db, &req).map_err(rpc_error)?;
Ok(ListFlowsResponse { flows, total })
}