@bobfrankston/rmfmail 1.1.189 → 1.1.191

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,6 +3112,7 @@ 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) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.72",
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.72",
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.72",
3
+ "version": "0.1.73",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",