@bobfrankston/rmfmail 1.1.124 → 1.1.125

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.
@@ -3205,6 +3205,15 @@ export class ImapManager extends EventEmitter {
3205
3205
  }
3206
3206
  continue;
3207
3207
  }
3208
+ // Success — clear the in-flight delete/move
3209
+ // suppression (see the IMAP branch below for the
3210
+ // full rationale). After a move the local row lives
3211
+ // at the TARGET folder, so the (uid, folder) lookup
3212
+ // uses targetFolderId.
3213
+ if (action.action === "move") {
3214
+ this.db.clearTombstoneForUid(accountId, action.uid, action.targetFolderId);
3215
+ this.db.clearMessagePendingDelete(accountId, action.uid, action.targetFolderId);
3216
+ }
3208
3217
  this.db.completeSyncAction(action.id);
3209
3218
  } catch (e: any) {
3210
3219
  console.error(` [api] ${accountId}: flag sync failed UID ${action.uid}: ${e.message}`);
@@ -3213,7 +3222,10 @@ export class ImapManager extends EventEmitter {
3213
3222
  // Terminal failure on delete/move → clear tombstone
3214
3223
  // so the row reappears on next sync (server still
3215
3224
  // has it). Same rationale as the IMAP branch below.
3216
- if (action.action === "delete" || action.action === "move") {
3225
+ if (action.action === "move") {
3226
+ this.db.clearTombstoneForUid(accountId, action.uid, action.targetFolderId);
3227
+ this.db.clearMessagePendingDelete(accountId, action.uid, action.targetFolderId);
3228
+ } else if (action.action === "delete") {
3217
3229
  this.db.clearTombstoneForUid(accountId, action.uid, action.folderId);
3218
3230
  }
3219
3231
  this.db.completeSyncAction(action.id);
@@ -3287,6 +3299,22 @@ export class ImapManager extends EventEmitter {
3287
3299
  break;
3288
3300
  }
3289
3301
  }
3302
+ // Success: the local action reached the server. Lift the
3303
+ // in-flight delete/move suppression so the destination
3304
+ // folder syncs the moved message under its real
3305
+ // post-move UID. hasTombstone's documented contract is
3306
+ // "cleared on successful action complete OR permanent
3307
+ // failure" — only the failure half had been wired, so a
3308
+ // successful move left a Message-ID tombstone alive for
3309
+ // 30 days, blocking the Trash folder from ever storing
3310
+ // the message (and resurrecting it once the tombstone
3311
+ // finally aged out). After a move the local row lives at
3312
+ // the TARGET folder, so the (uid, folder) lookup uses
3313
+ // targetFolderId.
3314
+ if (action.action === "move") {
3315
+ this.db.clearTombstoneForUid(accountId, action.uid, action.targetFolderId);
3316
+ this.db.clearMessagePendingDelete(accountId, action.uid, action.targetFolderId);
3317
+ }
3290
3318
  this.db.completeSyncAction(action.id);
3291
3319
  } catch (e: any) {
3292
3320
  console.error(` [sync] Failed action ${action.action} UID ${action.uid}: ${e.message}`);
@@ -3302,7 +3330,12 @@ export class ImapManager extends EventEmitter {
3302
3330
  // reflecting "your action didn't take, here it is
3303
3331
  // again." Applies to delete + move; flags/append
3304
3332
  // never tombstone.
3305
- if (action.action === "delete" || action.action === "move") {
3333
+ if (action.action === "move") {
3334
+ // Local row is at the TARGET folder (the local
3335
+ // move committed; only the server move failed).
3336
+ this.db.clearTombstoneForUid(accountId, action.uid, action.targetFolderId);
3337
+ this.db.clearMessagePendingDelete(accountId, action.uid, action.targetFolderId);
3338
+ } else if (action.action === "delete") {
3306
3339
  this.db.clearTombstoneForUid(accountId, action.uid, action.folderId);
3307
3340
  }
3308
3341
  this.db.completeSyncAction(action.id);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bobfrankston/mailx-imap",
9
- "version": "0.1.56",
9
+ "version": "0.1.57",
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.56",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",