@bobfrankston/rmfmail 1.1.218 → 1.1.219

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.
@@ -1323,13 +1323,20 @@ export class ImapManager extends EventEmitter {
1323
1323
  // from wiping anything we shouldn't.
1324
1324
  console.log(` [qresync] ${accountId}/${folder.path}: UIDVALIDITY changed (was ${prevUidValidity}, now ${qr.exists}); falling back to full sync`);
1325
1325
  } else if (qr.vanishedUids.length > VANISHED_ABSURD_CAP) {
1326
- // Refuse the absurd VANISHED set; do NOT iterate/apply it and
1327
- // do NOT return — fall through to the bounded set-diff
1328
- // reconcile (same as the UIDVALIDITY-changed path). The
1329
- // modseq watermark is left intact, so a healthy later QRESYNC
1330
- // can still succeed.
1326
+ // Refuse the absurd VANISHED set; do NOT iterate/apply it.
1331
1327
  const localCount = this.db.getMessageCount(accountId, folderId);
1332
- console.error(` [qresync] ${accountId}/${folder.path}: REFUSING VANISHED of ${qr.vanishedUids.length} UIDs (folder has ${localCount} locally) — almost certainly a mis-parsed range; falling back to set-diff reconcile instead of mass-deleting/wedging.`);
1328
+ console.error(` [qresync] ${accountId}/${folder.path}: REFUSING VANISHED of ${qr.vanishedUids.length} UIDs (folder has ${localCount} locally) — mis-parsed range; self-healing (advance watermark) + falling back to set-diff.`);
1329
+ // SELF-HEAL: advance the modseq watermark to the server's
1330
+ // CURRENT value. Without this the next QRESYNC re-requests the
1331
+ // same giant `(EARLIER) 1:N` range every cycle forever (Bob saw
1332
+ // it recur 21:03 → 21:20) — refusing without advancing isn't
1333
+ // self-healing. The set-diff reconcile below discovers + applies
1334
+ // the ACTUAL deletions via Message-ID identity (bounded, 50%
1335
+ // guard), so skipping the literal VANISHED loses nothing; it
1336
+ // just breaks the stale-modseq loop so future QRESYNCs are clean.
1337
+ if (qr.newHighestModSeq !== undefined) {
1338
+ this.db.updateFolderSync(folderId, prevUidValidity, String(qr.newHighestModSeq));
1339
+ }
1333
1340
  } else {
1334
1341
  // Apply VANISHED — server says these UIDs are gone. No
1335
1342
  // tombstone, no diff, just delete the local rows.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bobfrankston/mailx-imap",
9
- "version": "0.1.83",
9
+ "version": "0.1.84",
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.83",
3
+ "version": "0.1.84",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",