@bobfrankston/rmfmail 1.1.188 → 1.1.190

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.
@@ -2902,6 +2902,15 @@ export class ImapManager extends EventEmitter {
2902
2902
  : 12 * 3600_000;
2903
2903
  return Date.now() - f.lastTried < backoffMs;
2904
2904
  }
2905
+ /** Clear a UID's prefetch-failure record after a successful fetch, so a
2906
+ * message that healed (e.g. a transient iflow protocol desync that
2907
+ * resolved on retry) doesn't carry a stale backoff count into the
2908
+ * future. Without this, a once-failed-then-succeeded UID keeps its
2909
+ * count and would back off longer than warranted if it ever re-enters
2910
+ * the candidate set. */
2911
+ private clearPrefetchEmpty(accountId: string, folderId: number, uid: number): void {
2912
+ this.prefetchFailures.delete(`${accountId}:${folderId}:${uid}`);
2913
+ }
2905
2914
 
2906
2915
  /** Background body-cache backfill. Public so the Reconciler can schedule
2907
2916
  * the periodic tick under its priority/back-pressure rules; existing
@@ -3103,10 +3112,22 @@ export class ImapManager extends EventEmitter {
3103
3112
  const parsed = await extractPreview(source);
3104
3113
  this.db.updateBodyMeta(accountId, uid, bodyPath, parsed.hasAttachments, parsed.preview);
3105
3114
  this.emit("bodyCached", accountId, uid);
3115
+ this.clearPrefetchEmpty(accountId, folderId, uid); // healed — drop stale backoff
3106
3116
  counters.totalFetched++;
3107
3117
  madeProgress = true;
3108
3118
  } catch (e: any) {
3109
3119
  console.error(` [prefetch] ${accountId}/${uid}: store write failed: ${e.message}`);
3120
+ // Back off this UID. A corrupt body (the
3121
+ // putMessage guard rejecting an IMAP command
3122
+ // leaked into the FETCH response — iflow
3123
+ // protocol desync) was NOT marked, so the
3124
+ // same poisoned UID got re-fetched every
3125
+ // prefetch cycle forever, spamming the log
3126
+ // and wasting fetch turns (Bob 2026-05-28
3127
+ // "why is prefetching still broken" — UID
3128
+ // 59686 failing on a loop). markPrefetchEmpty
3129
+ // applies the 5m→30m→2h→12h backoff.
3130
+ this.markPrefetchEmpty(accountId, folderId, uid);
3110
3131
  }
3111
3132
  })());
3112
3133
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bobfrankston/mailx-imap",
9
- "version": "0.1.71",
9
+ "version": "0.1.73",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@bobfrankston/iflow-direct": "^0.1.27",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",