Skip to content

fix(fetcher): limit fetch chunks#1346

Open
puneetdixit200 wants to merge 1 commit into
floatpane:masterfrom
puneetdixit200:fix/1106-fetch-limit-chunk-size
Open

fix(fetcher): limit fetch chunks#1346
puneetdixit200 wants to merge 1 commit into
floatpane:masterfrom
puneetdixit200:fix/1106-fetch-limit-chunk-size

Conversation

@puneetdixit200
Copy link
Copy Markdown

@puneetdixit200 puneetdixit200 commented May 22, 2026

What?

  • remove the hard 50-message minimum chunk size in FetchMailboxEmails
  • add a TLS IMAP recorder regression that verifies limit=5 fetches only 96:100 from a 100-message mailbox

Why?

When callers request a small page, the fetcher should not over-fetch 50 messages before filtering and trimming. This keeps IMAP bandwidth and server load proportional to the requested limit.

Fixes #1106

Tests

  • GOMODCACHE=/tmp/matcha-1106-gomodcache GOCACHE=/tmp/matcha-1106-gocache go test ./fetcher -run TestFetchMailboxEmailsUsesRequestedLimitForSmallFetchChunks -count=1
  • GOMODCACHE=/tmp/matcha-1106-gomodcache GOCACHE=/tmp/matcha-1106-gocache make test
  • GOMODCACHE=/tmp/matcha-1106-gomodcache GOCACHE=/tmp/matcha-1106-gocache make lint
  • git diff --check

@puneetdixit200 puneetdixit200 requested a review from a team as a code owner May 22, 2026 13:57
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @puneetdixit200! Please fix the following issues with your PR:

  • Title: Is too long (40 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added area/fetcher IMAP fetch / IDLE / search bug Something isn't working size/L Diff: 201–800 lines labels May 22, 2026
@puneetdixit200 puneetdixit200 changed the title fix(fetcher): respect small fetch limits fix(fetcher): limit fetch chunks May 22, 2026
@floatpanebot floatpanebot dismissed their stale review May 22, 2026 13:58

Formatting issues have been resolved. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fetcher IMAP fetch / IDLE / search bug Something isn't working size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Fetcher chunkSize over-fetches when caller asks for fewer than 50

2 participants