estimate: counts-only for JMAP and Microsoft Graph #72

Merged
jcoffey-dev merged 1 commits from feat/estimate-counts-jmap-graph into main 2026-11-12 17:31:18 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev a70efdbb82 estimate: counts-only for JMAP and Microsoft Graph
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 5m31s
ci / announce (pull_request) Skipped
--estimate now covers the two remaining online sources. Both can
enumerate an object's id cheaply, but a size would cost a body fetch per
object, so these report counts without bytes: for each type, how many
objects are new since the archive was last filled.

JMAP already computes that delta in its dry run (new versus what the
archive holds); the estimate just keeps the per-type summary instead of
printing the dry-run table and discarding it.

Graph's dry run only counted folders, so this adds a read-only item
pass (src/sync/import_exchange_graph/estimate.rs): it walks the same
folder tree the import does, enumerates message, event and contact ids
with $select=id, and counts those not already in the archive. It skips
single occurrences exactly as the import does (it stores the series
master) and walks nested and default contact folders, so the count
matches what an import would create and a re-estimate finds nothing new.
It writes nothing.

The shared new-id counter is a small, unit-tested helper. README, the
--estimate help and the fallback note now distinguish sized sources
from these counts-only ones.
2026-11-12 10:21:42 -07:00