From 3dc53b9827a7cd5ef4e78d44645cde4d91524144 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 3 Nov 2026 10:55:10 +0100 Subject: [PATCH] read-floor: the wire race walks a status-filtered cursor across commits, so a stale status_changed fails it Co-Authored-By: Claude Opus 5.5 --- crates/huginn-daemon/src/serve.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/huginn-daemon/src/serve.rs b/crates/huginn-daemon/src/serve.rs index d980b18..e5e9a9f 100644 --- a/crates/huginn-daemon/src/serve.rs +++ b/crates/huginn-daemon/src/serve.rs @@ -899,6 +899,7 @@ mod tests { let of_specs = |extra: Selection| Selection { schemas: Some(vec![K::Question.type_id().into()]), ..extra }; let in_force = FieldPredicate { index: "in_force".into(), op: "any_of".into(), values: Some(vec!["true".into()]), number: None }; let mut recorded: Vec<(Selection, huginn_mind::PipelineSelectionPage)> = Vec::new(); + let mut status_walk = of_specs(Selection { fields: Some(vec![in_force.clone()]), limit: Some(1), projection: "document".into(), ..Selection::default() }); let mut head = 0; let mut round = 0; while !done.load(Ordering::Relaxed) || round < 3 { @@ -924,6 +925,14 @@ mod tests { None => break, } } + // A status walk: its cursor pins the snapshot it began at while the writer + // closes and reopens the questions, so a page is read at an old snapshot + // through the status filter and the document, which only the row's + // status_changed can answer. + let page = query(&mut client, &status_walk); + let next = page.next.clone(); + recorded.push((status_walk.clone(), page)); + status_walk.cursor = next; let hop = Selection { cited: Some(cultnet_rs::Incoming { role: "subject".into(), exists: true }), ..Selection::default() }; let page = query(&mut client, &hop); recorded.push((hop, page));