KamoCRM

Message listings say how many messages they hold (X-Total-Count)

FeatureEmailService
Shipped
October 10, 2026 at 3:03 AM UTC
Author
Kamo
Commit
12926f6

The message list in kamo-internal can now be browsed by pages, and its pager needs the listing's size for "51-100 of 1,240" and a Last button. Every listing answered with rows alone, though most of them had already worked the count out and thrown it away. The total travels as an X-Total-Count header; the body stays the bare array every caller reads (the kamo-internal first-page fetcher refuses anything else, and @kamo/email-core reads the same endpoint). The header is left off when the total is unknown, never sent as a zero. - Folders (IMAP): **************** returns the EXISTS count it already reads to cut the page. MailReader.listMessagePage is new, with a default that reports the total as unknown (Graph keeps that for now); listMessages is unchanged for the sync, filter-rule and lead-mail callers. - Folders served from the metadata index: the total is the folder status that proved the index current, so rows and count describe one folder. - Shared mailboxes: same as folders. - Labels: the paged join-table query's own getTotalElements(). It also counts labelled messages the index has not seen yet, which are left off their page, so a short label page is no longer mistaken for the end. - Smart folders: inferred from a short page; one COUNT over the same conditions only for a full page or an empty one past the first.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing