From d0ebda2fb2576544fecb99c5dd1375231ff6514b Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 7 Oct 2026 18:25:02 +0200 Subject: fix(mail): recount unread when the notmuch database commits Accounts counted only at shell start and when the mail page opened, so the drawer tile drifted behind the inbox for the rest of the session: it read 14 while notmuch and the waybar pill both said 16. The waybar pill never drifted because waybar-mail.sh watches the database; the drawer had no watcher. Accounts now runs its own inotifywait -m on the xapian directory (the directory, because Xapian replaces files on commit) and refreshes 300ms after a commit burst settles. The watcher respawns after 5s if it exits, since a dead one reproduces the drift with no visible error. This is the prerequisite for removing waybar: the drawer becomes the only place the unread count is shown. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/mail/README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'desktop/modules/mail/README.md') diff --git a/desktop/modules/mail/README.md b/desktop/modules/mail/README.md index 3b9f89e..ced87f3 100644 --- a/desktop/modules/mail/README.md +++ b/desktop/modules/mail/README.md @@ -61,6 +61,12 @@ back is a legitimate path for an account with no label. ## Counting +**The counts follow the database, not the drawer.** `Accounts` runs its own +`inotifywait -m` on the xapian directory and recounts 300ms after a commit +burst settles. Before that it counted only at shell start and on opening the +page, so the tile read 14 while the inbox held 16. The watcher respawns after +5s if it dies, since a dead one reproduces that drift silently. + Every count is `tag:unread and tag:inbox`. Plain `tag:unread` also counts archived-but-unread mail and mailing list traffic that was never in the inbox, which for one account here was the difference between 32 and 41; the -- cgit v1.2.3