@bobfrankston/iflow-direct 0.1.57 → 0.1.59
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/imap-native.js +11 -2
- package/package.json +1 -1
package/imap-native.js
CHANGED
|
@@ -588,13 +588,19 @@ export class NativeImapClient {
|
|
|
588
588
|
}
|
|
589
589
|
const allMessages = [];
|
|
590
590
|
let chunkSize = this.fetchChunkSize;
|
|
591
|
-
|
|
591
|
+
// Advance by the chunk ACTUALLY fetched, then grow. The old
|
|
592
|
+
// `i += chunkSize` used the post-growth size, so after chunk 1
|
|
593
|
+
// (say 25 UIDs) the index jumped 100 — UIDs 25..99 were silently
|
|
594
|
+
// skipped on every multi-chunk fetch (imail "skips some letters",
|
|
595
|
+
// Bob 2026-07-17; mailx relied on set-diff sweeps to mop up).
|
|
596
|
+
for (let i = 0; i < uids.length;) {
|
|
592
597
|
const chunk = uids.slice(i, i + chunkSize);
|
|
593
598
|
const msgs = await this.fetchMessages(chunk.join(","), options);
|
|
594
599
|
allMessages.push(...msgs);
|
|
595
600
|
// console.log(` [fetch] ${allMessages.length}/${uids.length} (chunk of ${chunk.length})`);
|
|
596
601
|
if (onChunk)
|
|
597
602
|
onChunk(msgs);
|
|
603
|
+
i += chunk.length;
|
|
598
604
|
if (chunkSize < this.fetchChunkSizeMax)
|
|
599
605
|
chunkSize = Math.min(chunkSize * 4, this.fetchChunkSizeMax);
|
|
600
606
|
}
|
|
@@ -622,7 +628,9 @@ export class NativeImapClient {
|
|
|
622
628
|
const allMessages = [];
|
|
623
629
|
let chunkSize = this.fetchChunkSize;
|
|
624
630
|
let chunkIndex = 0;
|
|
625
|
-
|
|
631
|
+
// Advance by the chunk ACTUALLY fetched, then grow — same skipped-
|
|
632
|
+
// UIDs bug as fetchSinceUid (see comment there).
|
|
633
|
+
for (let i = 0; i < uids.length;) {
|
|
626
634
|
const chunk = uids.slice(i, i + chunkSize);
|
|
627
635
|
const msgs = await this.fetchMessages(chunk.join(","), options);
|
|
628
636
|
allMessages.push(...msgs);
|
|
@@ -635,6 +643,7 @@ export class NativeImapClient {
|
|
|
635
643
|
}
|
|
636
644
|
if (onChunk)
|
|
637
645
|
onChunk(msgs);
|
|
646
|
+
i += chunk.length;
|
|
638
647
|
if (chunkSize < this.fetchChunkSizeMax)
|
|
639
648
|
chunkSize = Math.min(chunkSize * 4, this.fetchChunkSizeMax);
|
|
640
649
|
}
|