matcha
matcha copied to clipboard
BUG: N+1 query problem in email body fetching
Describe the bug: Email bodies fetched one-by-one in loop. For inbox with 100 emails, makes 100 separate IMAP FETCH calls. Extremely slow on high-latency connections.
To reproduce:
- Open inbox with 100+ emails
- Monitor IMAP traffic
- See individual FETCH commands for each email
- Takes several minutes on slow connection
Expected behavior: Batch FETCH commands. Use IMAP sequence sets to fetch multiple bodies in single command.
Additional context:
- File: fetcher/fetcher.go
- Classic N+1 query antipattern
- Should use "1:100" sequence sets
- Need to handle IMAP response size limits
- Severity: High - performance issue
- Complexity: High - IMAP protocol knowledge required
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.