Avoid full unflagged mailbox rescan on every IDLE wakeup #12
Labels
No labels
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
dep-scan/ignore
finding
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IUS/xr-invoiced#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
internal/imap/idle.gosearches all messages without the custom keyword after each IDLE cycle.Reference:
internal/imap/idle.go:102.On a mailbox with many historical non-invoice messages, every new message can trigger a full rescan of all unflagged mail. In dry-run mode this is worse because no messages are flagged, so the same historical set is repeatedly scanned.
Expected
IDLE wakeups should primarily process new UIDs. Broad recovery scans should be bounded, scheduled, or made explicit.
Suggested fix
Limit the unflagged search to a recent UID/date range, run it only on explicit recovery/force mode, or make it configurable with clear defaults.
Fixed by
77735bb(fix: IDLE wakeup no longer rescans entire mailbox).That commit removes the SearchUnflaggedUIDs(customFlag) call from the IDLE hot path and changes the loop to search only for new UIDs (> lastUID), repeating until no more new messages arrive.
The regression branch regression/issue-12-idle-unflagged-scan now passes on current master.
Branch renamed per convention:
Old: regression/issue-12-idle-unflagged-scan
New: fix/12-idle-unflagged-scan
The old remote branch has been deleted. This issue remains closed because the regression guard already passes on current master.
Implementation branch: fix/12-idle-unflagged-scan-codex
Closing as fixed.
The issue was addressed by commit
77735bb, fix: IDLE wakeup no longer rescans entire mailbox.That change removed the unbounded SearchUnflaggedUIDs(customFlag) call from the IDLE hot path. After each IDLE wakeup the scanner now searches only for new UIDs greater than lastUID, repeating until no more new messages arrive.
Regression coverage exists on branch fix/12-idle-unflagged-scan and passes on current master.