Look up only the changed ids on each JMAP pass (#171) #177
No reviewers
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp!177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/171-source-flags-scan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #171.
Summary
source_flagsholds the store lock per chunk, not across the whole read, so a waiting IMAP account gets the lock between chunks.Evidence
Before: a delta pass with no changes called
source_flags(account)and read every row. On a store of about 249,000 messages this cost about 1 GB of disk reads per pass, and the pass interval was 324 s at p50 (see #171).After: new tests in
tests/test_jmap.pyandtests/test_store.py:make check: 1,315 passed and 8 skipped; mypy, ruff and pip-audit clean.Not measured on a live mirror yet. That needs a release.
Merge Danger
Door: two-way
No schema change and no change to stored data. A revert restores the old full read.
Blast Radius: sync
Only the JMAP sync pass changes. A reconcile, which runs after a mailbox change or lost changes, still looks up every remote id, now as chunked index seeks instead of one scan. That can be a little slower on a cold cache. The reconcile also fetches every Email from the server, which costs more. Fix 3 in #171 (a covering index) would remove the cost and needs a schema change; it is not in this PR.
🤖 Generated with Claude Code