8000 (via norrietaylor): fix(diag): continue directory walk when sessions/index.json is absent by macroscopeapp[bot] · Pull Request #913 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/minimald/src/diag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,10 @@ async fn sessions<W: BundleSink>(
w.add_bytes("sessions/index.json", &bytes, Redaction::None)
.await?
}
// No index at all: this daemon has never created a session, so there
// are no per-session directories to walk either.
Ok(None) => return Ok(()),
// A missing index doesn't mean we can skip the walk: orphan session
// records may still exist (e.g., an interrupted write), so note the
// missing file and continue to the directory enumeration.
Ok(None) => w.skip("sessions/index.json", "not present"),
// An unreadable index is not a reason to withhold the records it
// indexes, so this notes the omission and carries on.
Err(e) => w.skip("sessions/index.json", format!("unreadable: {e:#}")),
Expand Down
0