- Ya
- 14 Agosti 2026, 04:51 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 42302b9
Three things, all about knowing rather than assuming. The nav-top unread badge fetched the entire folder tree and picked INBOX out of the result — the most expensive call the mail backend makes, to render a number. MailReader has carried getUnreadCount for exactly this since it was written (a single STATUS on the IMAP providers, an inline field on Graph) and nothing ever exposed it over HTTP. Now it does. This is a fallback path that only fires when the unread socket has failed, so it is rare and was expensive precisely when things were already going wrong. The index-backed listing now reports why it did or did not serve, as **************** and the actuator exposes metrics so the counters can be read. The ratio of served to modseq_moved is the number that says whether that path earns its complexity, and it is not answerable by reading the code: a folder invalidates its own checkpoint as soon as someone reads a message in it, so the hit rate is a fact about how members move through their mail. The proof it reports is now an enum rather than a boolean, so each refusal is attributed instead of lumped together, and the tests assert the specific reason — a test that accepted any refusal would let those buckets drift into nonsense. Also fixes a flaky test I watched fail three times this afternoon and which is not mine: ImapIdleRegistryTest polled a mock with Mockito's timeout() to see the async close land, and on a loaded machine that expires while the close is merely queued behind thread creation. It fails as "zero interactions", which reads like a broken registry and is really a busy CPU. It now waits on a latch that wakes the instant close() is entered, matching the sibling test two methods down, and the parked thread is interrupted in a finally block — a failing run used to leak one sleeping non-daemon thread for thirty seconds and slow down everything after it, including the next attempt at the same test. Three full suites run concurrently: 257 passed, three times over.