memoryd: a staged write's id counts every write staged that day

This commit is contained in:
2026-09-25 16:41:44 -07:00
parent 81107bc5c6
commit 34dbbb27be
3 changed files with 82 additions and 3 deletions
+3 -3
View File
@@ -92,8 +92,8 @@ pub fn submit(
) -> Result<String, String> {
// 1. `args.check()?`.
// 2. `day` is the first 10 characters of `ctx.now.to_rfc3339()`. `taken` = how many Waiting
// lines have an id starting format!("p-{day}-"). The id is format!("p-{day}-{:04}", taken +
// 1).
// lines of `lines(store)?`, done or not, have an id starting format!("p-{day}-"): an id is
// never used twice. The id is format!("p-{day}-{:04}", taken + 1).
// 3. `add` a Waiting line: id, time `ctx.now.to_rfc3339()`, session, call and taint from ctx,
// arguments as given.
// 4. Ok(format!("waiting for the owner's review ({id}); nothing is changed until it is
@@ -101,7 +101,7 @@ pub fn submit(
args.check()?;
let rfc = ctx.now.to_rfc3339();
let day = rfc.get(..10).unwrap_or("0000-00-00");
let taken = waiting(store)?
let taken = lines(store)?
.iter()
.filter(|line| match line {
Line::Waiting { id, .. } => id.starts_with(&format!("p-{day}-")),