@bobfrankston/iflow-direct 0.1.54 → 0.1.55

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.
Files changed (2) hide show
  1. package/imap-native.js +17 -2
  2. package/package.json +1 -1
package/imap-native.js CHANGED
@@ -553,10 +553,25 @@ export class NativeImapClient {
553
553
  return;
554
554
  if (this.selectedMailbox !== folderPath)
555
555
  await this.select(folderPath);
556
- await this.fetchMessagesStream(uids.join(","), { source: true, headers: false }, (msg) => {
557
- if (msg.uid && msg.source)
556
+ // headers default (was `headers: false`): the single-message body fetch
557
+ // path (fetchMessage fetchMessagesStream, headers DEFAULT) extracts
558
+ // BODY[] correctly, but this batch path passed `headers: false` and
559
+ // returned 0 bodies 100% of the time — so prefetch never cached anything
560
+ // and bodies only landed when the user opened a message (Bob 2026-06-17
561
+ // "predownloading still broken"). The only difference between the two
562
+ // paths was this flag; matching the working path. Diagnostic counters
563
+ // confirm extraction so a regression is visible in the log.
564
+ let got = 0, sawResp = 0;
565
+ await this.fetchMessagesStream(uids.join(","), { source: true }, (msg) => {
566
+ sawResp++;
567
+ if (msg.uid && msg.source) {
568
+ got++;
558
569
  onBody(msg.uid, msg.source);
570
+ }
559
571
  });
572
+ if (got === 0 && uids.length > 0) {
573
+ console.error(` [imap] fetchBodiesBatch ${folderPath}: 0/${uids.length} bodies (saw ${sawResp} FETCH responses) — body literal not extracted`);
574
+ }
560
575
  }
561
576
  /** Fetch messages since a UID */
562
577
  async fetchSinceUid(sinceUid, options = {}, onChunk) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",