@bobfrankston/mailx-imap 0.1.79 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2968,7 +2968,17 @@ export class ImapManager extends EventEmitter {
|
|
|
2968
2968
|
// BATCH_SIZE rows that all get filtered to zero, and the loop
|
|
2969
2969
|
// terminates without ever trying live messages further down the
|
|
2970
2970
|
// size-asc list.
|
|
2971
|
-
|
|
2971
|
+
// Exclude error-cooled folders AT THE QUERY so a single bloated /
|
|
2972
|
+
// perpetually-failing folder (a stuck server-side Outbox, a 300s
|
|
2973
|
+
// archive) can't fill the entire size-asc batch and starve every
|
|
2974
|
+
// healthy folder. Recomputed each iteration: a folder that trips
|
|
2975
|
+
// its cooldown mid-loop drops out on the next pull (Bob 2026-06-01
|
|
2976
|
+
// "so much unfetched — nothing draining"). Empty when no folder is
|
|
2977
|
+
// cooling, so the common case is unchanged.
|
|
2978
|
+
const coolingFolderIds = this.db.getFolders(accountId)
|
|
2979
|
+
.filter(f => this.shouldSkipFolder(accountId, f.path))
|
|
2980
|
+
.map(f => f.id);
|
|
2981
|
+
const raw = this.db.getMessagesWithoutBody(accountId, BATCH_SIZE * 4, coolingFolderIds);
|
|
2972
2982
|
const missing = raw.filter(m => !this.isPrefetchEmpty(accountId, m.folderId, m.uid))
|
|
2973
2983
|
.slice(0, BATCH_SIZE);
|
|
2974
2984
|
if (missing.length === 0)
|