diff options
Diffstat (limited to 'docs/superpowers/specs')
| -rw-r--r-- | docs/superpowers/specs/2026-09-12-mail-overview-design.md | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/docs/superpowers/specs/2026-09-12-mail-overview-design.md b/docs/superpowers/specs/2026-09-12-mail-overview-design.md index a691d79..6b2423b 100644 --- a/docs/superpowers/specs/2026-09-12-mail-overview-design.md +++ b/docs/superpowers/specs/2026-09-12-mail-overview-design.md @@ -243,9 +243,14 @@ inotify watch on top of the timer. ## Error handling -- notmuch exits 0 even for a malformed query, printing something that is not - a count, so every count is validated as a non-negative integer and the exit - status is not the test. +- A malformed query is not reliably detectable. `notmuch count 'tag:unread + and (('` returns `41` and exits 0: Xapian accepts the fragment and answers a + different question, so a wrong count arrives looking exactly like a right + one. Nothing in this component can catch that, and it is not worth trying to; + the queries here are fixed strings, not user input. + What validation does catch is the clean failure: `notmuch count 'tag:unread + and ('` prints nothing and exits 1. Empty or non-numeric output therefore + renders as an error rather than as a zero. - notmuch missing, the database locked, or a count that fails validation: the count shows a dash, never a zero. A zero that is actually a failure reads as "no new mail", which is the same class of mistake as reporting a libvirt host side figure as guest |
