Describe the bug
fetcher/fetcher.go:415-418:
chunkSize := limit
if chunkSize < 50 {
chunkSize = 50
}
If the caller requests limit=5, we still fetch 50 from IMAP per loop, filter, sort, append, and trim to 5. That's a 10× waste of bandwidth and IMAP server load on every paginated tail.
Expected behavior
Use limit directly; only inflate if the filter is known to drop more than half the messages (and bias the inflation to the historical hit rate).
Describe the bug
fetcher/fetcher.go:415-418:If the caller requests
limit=5, we still fetch 50 from IMAP per loop, filter, sort, append, and trim to 5. That's a 10× waste of bandwidth and IMAP server load on every paginated tail.Expected behavior
Use
limitdirectly; only inflate if the filter is known to drop more than half the messages (and bias the inflation to the historical hit rate).