[arch] Decouple delta caching and Gmail label enrichment from MailboxGateway to MailboxPipeline #66

Closed
opened 2026-08-31 00:29:25 +03:00 by jalmari · 1 comment
Owner

Parent

Part of #62

What to build

Decouple high-level delta cache merging and Gmail cross-folder label enrichment from MailboxGateway, moving them into MailboxPipeline. Keep MailboxGateway focused purely on IMAP protocol communication, folder selection, and message fetching/moving.

Acceptance criteria

  • Refactor MailboxGateway::scan to perform batch IMAP header fetching without internal delta cache merging.
  • Move delta UID merging and Gmail with_merged_labels deduplication logic into MailboxPipeline::scan.
  • Simplify FakeImapTransport and protocol tests to focus on transport verification.
  • Ensure end-to-end incremental scan tests in est_gateway_and_cache.rs and est_pipeline_and_audit.rs pass.
  • Ensure cargo fmt and cargo clippy --all-targets --all-features -- -D warnings pass cleanly.

Blocked by

  • #63 ([arch] Eliminate shallow ScanCache and consolidate cache lifecycle into ScanResult)
## Parent Part of #62 ## What to build Decouple high-level delta cache merging and Gmail cross-folder label enrichment from MailboxGateway, moving them into MailboxPipeline. Keep MailboxGateway focused purely on IMAP protocol communication, folder selection, and message fetching/moving. ## Acceptance criteria - [ ] Refactor MailboxGateway::scan to perform batch IMAP header fetching without internal delta cache merging. - [ ] Move delta UID merging and Gmail with_merged_labels deduplication logic into MailboxPipeline::scan. - [ ] Simplify FakeImapTransport and protocol tests to focus on transport verification. - [ ] Ensure end-to-end incremental scan tests in est_gateway_and_cache.rs and est_pipeline_and_audit.rs pass. - [ ] Ensure cargo fmt and cargo clippy --all-targets --all-features -- -D warnings pass cleanly. ## Blocked by - #63 ([arch] Eliminate shallow ScanCache and consolidate cache lifecycle into ScanResult)
Author
Owner

Decoupled delta caching and Gmail label enrichment from MailboxGateway to MailboxPipeline. MailboxGateway now performs raw batch header fetching without cache or deduplication dependencies. All 71 tests pass.

Decoupled delta caching and Gmail label enrichment from MailboxGateway to MailboxPipeline. MailboxGateway now performs raw batch header fetching without cache or deduplication dependencies. All 71 tests pass.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Lavisys/mailsweep#66
No description provided.