@bobfrankston/mailx-imap 0.1.95 → 0.1.97

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/index.js +14 -7
  2. package/package.json +7 -7
package/index.js CHANGED
@@ -3430,12 +3430,19 @@ export class ImapManager extends EventEmitter {
3430
3430
  }
3431
3431
  }
3432
3432
  catch (e) {
3433
- console.error(` [prefetch] ${accountId}/${uid}: store write failed: ${e.message}`);
3434
- // putMessage / extractPreview failure (e.g. a
3435
- // corrupt body an IMAP command leaked into the
3436
- // FETCH response). Genuine poison: back off
3437
- // 5m→30m→2h→12h so it isn't re-fetched on a loop
3438
- // (Bob 2026-05-28, UID 59686).
3433
+ console.error(` [prefetch] ${accountId}/${uid}: store write failed: ${e?.message || e}`);
3434
+ // "IMAP command leaked into response stream" is NOT
3435
+ // a live connection desync the DESYNC CAPTURE
3436
+ // (2026-06-16) proved the parser is perfectly aligned
3437
+ // (server announces BODY[] {N}, we read exactly N).
3438
+ // It's a message whose body is PERMANENTLY corrupt on
3439
+ // the server (mailx APPENDed it with a leaked command
3440
+ // prepended in some past session). Discarding the
3441
+ // connection (my 1.2.12 mistake) just re-fetches the
3442
+ // same bad message and thrashes the socket — which
3443
+ // disrupted the SHARED slow-lane connection that sync
3444
+ // uses. Correct handling: back this one message off
3445
+ // (5m→30m→2h→12h) and leave the connection alone.
3439
3446
  this.markPrefetchEmpty(accountId, folderId, uid);
3440
3447
  }
3441
3448
  })());
@@ -3483,7 +3490,7 @@ export class ImapManager extends EventEmitter {
3483
3490
  // handled per-UID above and never reach here.
3484
3491
  const dead = /not connected|ETIMEDOUT|ECONNRESET|ECONNREFUSED|EPIPE|socket|connection (closed|reset|lost)|disconnect/i.test(msg);
3485
3492
  if (dead) {
3486
- console.log(` [prefetch] ${accountId}/${folder.path}: connection down — deferring rest to next tick`);
3493
+ console.log(` [prefetch] ${accountId}/${folder.path}: connection down — deferring rest to next tick (fresh socket)`);
3487
3494
  break;
3488
3495
  }
3489
3496
  if (counters.errors >= ERROR_BUDGET)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.95",
3
+ "version": "0.1.97",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@bobfrankston/mailx-types": "^0.1.19",
13
- "@bobfrankston/mailx-settings": "^0.1.26",
14
- "@bobfrankston/mailx-store": "^0.1.49",
15
- "@bobfrankston/iflow-direct": "^0.1.53",
13
+ "@bobfrankston/mailx-settings": "^0.1.28",
14
+ "@bobfrankston/mailx-store": "^0.1.51",
15
+ "@bobfrankston/iflow-direct": "^0.1.54",
16
16
  "@bobfrankston/tcp-transport": "^0.1.7",
17
17
  "@bobfrankston/smtp-direct": "^0.1.9",
18
18
  "@bobfrankston/mailx-sync": "^0.1.22",
@@ -38,9 +38,9 @@
38
38
  ".transformedSnapshot": {
39
39
  "dependencies": {
40
40
  "@bobfrankston/mailx-types": "^0.1.19",
41
- "@bobfrankston/mailx-settings": "^0.1.26",
42
- "@bobfrankston/mailx-store": "^0.1.49",
43
- "@bobfrankston/iflow-direct": "^0.1.53",
41
+ "@bobfrankston/mailx-settings": "^0.1.28",
42
+ "@bobfrankston/mailx-store": "^0.1.51",
43
+ "@bobfrankston/iflow-direct": "^0.1.54",
44
44
  "@bobfrankston/tcp-transport": "^0.1.7",
45
45
  "@bobfrankston/smtp-direct": "^0.1.9",
46
46
  "@bobfrankston/mailx-sync": "^0.1.22",