@bobfrankston/rmfmail 1.1.2 → 1.1.4

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 (91) hide show
  1. package/bin/mailx.js +10 -13
  2. package/bin/mailx.js.map +1 -1
  3. package/bin/mailx.ts +11 -13
  4. package/client/android-bootstrap.bundle.js +1 -1
  5. package/client/android-bootstrap.bundle.js.map +2 -2
  6. package/client/app.bundle.js +88 -17
  7. package/client/app.bundle.js.map +2 -2
  8. package/client/app.js +20 -20
  9. package/client/app.js.map +1 -1
  10. package/client/app.ts +20 -20
  11. package/client/components/context-menu.js +9 -0
  12. package/client/components/context-menu.js.map +1 -1
  13. package/client/components/context-menu.ts +8 -0
  14. package/client/components/message-viewer.js +21 -5
  15. package/client/components/message-viewer.js.map +1 -1
  16. package/client/components/message-viewer.ts +21 -5
  17. package/client/compose/compose.bundle.js +45 -1
  18. package/client/compose/compose.bundle.js.map +2 -2
  19. package/client/index.html +23 -4
  20. package/client/lib/api-client.js +41 -0
  21. package/client/lib/api-client.js.map +1 -1
  22. package/client/lib/api-client.ts +29 -0
  23. package/client/lib/mailxapi.js +11 -7
  24. package/client/lib/message-state.js +23 -0
  25. package/client/lib/message-state.js.map +1 -1
  26. package/client/lib/message-state.ts +21 -0
  27. package/package.json +9 -9
  28. package/packages/mailx-bus/index.d.ts +2 -0
  29. package/packages/mailx-bus/index.d.ts.map +1 -1
  30. package/packages/mailx-bus/index.js +9 -0
  31. package/packages/mailx-bus/index.js.map +1 -1
  32. package/packages/mailx-bus/index.ts +11 -0
  33. package/packages/mailx-bus/package.json +1 -1
  34. package/packages/mailx-bus/store-events.d.ts +79 -0
  35. package/packages/mailx-bus/store-events.d.ts.map +1 -0
  36. package/packages/mailx-bus/store-events.js +155 -0
  37. package/packages/mailx-bus/store-events.js.map +1 -0
  38. package/packages/mailx-bus/store-events.ts +165 -0
  39. package/packages/mailx-core/index.d.ts.map +1 -1
  40. package/packages/mailx-core/index.js +25 -3
  41. package/packages/mailx-core/index.js.map +1 -1
  42. package/packages/mailx-core/index.ts +23 -3
  43. package/packages/mailx-host/package.json +1 -1
  44. package/packages/mailx-imap/index.d.ts +0 -37
  45. package/packages/mailx-imap/index.d.ts.map +1 -1
  46. package/packages/mailx-imap/index.js +17 -172
  47. package/packages/mailx-imap/index.js.map +1 -1
  48. package/packages/mailx-imap/index.ts +17 -179
  49. package/packages/mailx-imap/package-lock.json +2 -2
  50. package/packages/mailx-imap/package.json +1 -1
  51. package/packages/mailx-service/index.d.ts +16 -0
  52. package/packages/mailx-service/index.d.ts.map +1 -1
  53. package/packages/mailx-service/index.js +89 -77
  54. package/packages/mailx-service/index.js.map +1 -1
  55. package/packages/mailx-service/index.ts +83 -75
  56. package/packages/mailx-service/local-store.d.ts +54 -2
  57. package/packages/mailx-service/local-store.d.ts.map +1 -1
  58. package/packages/mailx-service/local-store.js +147 -2
  59. package/packages/mailx-service/local-store.js.map +1 -1
  60. package/packages/mailx-service/local-store.ts +147 -3
  61. package/packages/mailx-service/reconciler.d.ts.map +1 -1
  62. package/packages/mailx-service/reconciler.js +28 -8
  63. package/packages/mailx-service/reconciler.js.map +1 -1
  64. package/packages/mailx-service/reconciler.ts +28 -8
  65. package/packages/mailx-service/sync-queue.d.ts +16 -0
  66. package/packages/mailx-service/sync-queue.d.ts.map +1 -1
  67. package/packages/mailx-service/sync-queue.js +33 -3
  68. package/packages/mailx-service/sync-queue.js.map +1 -1
  69. package/packages/mailx-service/sync-queue.ts +33 -3
  70. package/packages/mailx-settings/package.json +1 -1
  71. package/packages/mailx-store/bus.d.ts +79 -0
  72. package/packages/mailx-store/bus.d.ts.map +1 -0
  73. package/packages/mailx-store/bus.js +155 -0
  74. package/packages/mailx-store/bus.js.map +1 -0
  75. package/packages/mailx-store/index.d.ts +2 -0
  76. package/packages/mailx-store/index.d.ts.map +1 -1
  77. package/packages/mailx-store/index.js +5 -0
  78. package/packages/mailx-store/index.js.map +1 -1
  79. package/packages/mailx-store/index.ts +7 -0
  80. package/packages/mailx-store/package.json +2 -1
  81. package/packages/mailx-store-web/db.d.ts.map +1 -1
  82. package/packages/mailx-store-web/db.js +9 -1
  83. package/packages/mailx-store-web/db.js.map +1 -1
  84. package/packages/mailx-store-web/db.ts +9 -1
  85. package/packages/mailx-store-web/package.json +2 -1
  86. package/packages/mailx-store-web/sync-manager.d.ts +4 -0
  87. package/packages/mailx-store-web/sync-manager.d.ts.map +1 -1
  88. package/packages/mailx-store-web/sync-manager.js +32 -4
  89. package/packages/mailx-store-web/sync-manager.js.map +1 -1
  90. package/packages/mailx-store-web/sync-manager.ts +28 -4
  91. /package/packages/mailx-imap/{node_modules.npmglobalize-stash-36832 → node_modules.npmglobalize-stash-39436}/.package-lock.json +0 -0
@@ -7,7 +7,7 @@
7
7
  import { createAutoImapConfig, CompatImapClient } from "@bobfrankston/iflow-direct";
8
8
  import type { TransportFactory } from "@bobfrankston/tcp-transport";
9
9
  import { authenticateOAuth } from "@bobfrankston/oauthsupport";
10
- import { MailxDB, FileMessageStore, parseSerial } from "@bobfrankston/mailx-store";
10
+ import { MailxDB, FileMessageStore, parseSerial, storeBus } from "@bobfrankston/mailx-store";
11
11
  import { loadSettings, getStorePath, getConfigDir, getHistoryDays, getPrefetch } from "@bobfrankston/mailx-settings";
12
12
  import type { AccountConfig, MessageEnvelope, EmailAddress, Folder } from "@bobfrankston/mailx-types";
13
13
  import { EventEmitter } from "node:events";
@@ -283,6 +283,22 @@ export class ImapManager extends EventEmitter {
283
283
  console.log(` [reconcile-cancel] ${info.accountId} ${info.fromFolderId}/${info.fromUid}: deferred delete cancelled (move-detect rebound to ${info.toFolderId}/${info.toUid})`);
284
284
  }
285
285
  });
286
+ // Bridge legacy EventEmitter "folderCountsChanged" to the Store bus
287
+ // so subscribers can listen on a single mechanism. Done in-class
288
+ // rather than at every call site (~20 emit points in this file) to
289
+ // keep the diff small and avoid a per-call regression risk during
290
+ // the refactor. The Store bus is the long-term home; once every
291
+ // consumer subscribes via the bus, the legacy listeners in
292
+ // bin/mailx.ts get retired and the `this.emit("folderCountsChanged"...)`
293
+ // calls can convert in bulk.
294
+ this.on("folderCountsChanged", (accountId: string, payload: any) => {
295
+ storeBus.publish({
296
+ topic: `account:${accountId}`,
297
+ kind: "folderCountsChanged",
298
+ accountId,
299
+ folderId: payload?.folderId,
300
+ });
301
+ });
286
302
  }
287
303
 
288
304
  /** Get OAuth access token for an account (for SMTP auth) */
@@ -2945,135 +2961,6 @@ export class ImapManager extends EventEmitter {
2945
2961
  return this.bodyStore;
2946
2962
  }
2947
2963
 
2948
- /** Bulk trash messages — local-first, single IMAP connection for all */
2949
- async trashMessages(accountId: string, messages: { uid: number; folderId: number }[]): Promise<void> {
2950
- if (messages.length === 0) return;
2951
- const trash = this.findFolder(accountId, "trash");
2952
-
2953
- // Tombstone each Message-ID so sync won't re-import the source-folder
2954
- // row before the server-side MOVE completes. Cleared on permanent
2955
- // failure (clearTombstoneForUid in processSyncActions).
2956
- for (const msg of messages) {
2957
- const env = this.db.getMessageByUid(accountId, msg.uid, msg.folderId);
2958
- if (env?.messageId) this.db.addTombstone(accountId, env.messageId, env.subject || "");
2959
- }
2960
-
2961
- // Local first — move to trash folder locally so the row stays
2962
- // visible in Trash and Ctrl+Z can restore it. Body file stays in
2963
- // its original folder dir; the next sync rebinds path on
2964
- // membership uid change. Old behavior was `db.deleteMessage` +
2965
- // `unlinkBodyFile` which made undelete impossible (no row to
2966
- // restore, no body to read). For folders that ARE the trash
2967
- // already, fall through to hard delete (the action will EXPUNGE
2968
- // and reconciliation cleans up).
2969
- for (const msg of messages) {
2970
- if (trash && trash.id !== msg.folderId) {
2971
- this.db.moveMessageLocal(accountId, msg.uid, msg.folderId, trash.id);
2972
- } else {
2973
- this.unlinkBodyFile(accountId, msg.uid, msg.folderId).catch(() => {});
2974
- this.db.deleteMessage(accountId, msg.uid, "user-initiated trash (already in trash → expunge)", "mailx-imap trashMessages");
2975
- }
2976
- }
2977
- console.log(` Trashed ${messages.length} messages locally (moved to trash folder, body files retained)`);
2978
-
2979
- // Queue IMAP actions
2980
- for (const msg of messages) {
2981
- if (trash && trash.id !== msg.folderId) {
2982
- this.db.queueSyncAction(accountId, "move", msg.uid, msg.folderId, { targetFolderId: trash.id });
2983
- } else {
2984
- this.db.queueSyncAction(accountId, "delete", msg.uid, msg.folderId);
2985
- }
2986
- }
2987
-
2988
- // Recalc folder counts so the tree badge updates immediately instead
2989
- // of showing stale numbers until the next full sync.
2990
- const sourceFolderIds = new Set(messages.map(m => m.folderId));
2991
- for (const fid of sourceFolderIds) this.db.recalcFolderCounts(fid);
2992
- if (trash) this.db.recalcFolderCounts(trash.id);
2993
- this.emit("folderCountsChanged", accountId, {});
2994
-
2995
- // Process all queued actions in one IMAP session
2996
- this.debounceSyncActions(accountId);
2997
- }
2998
-
2999
- /** Bulk move messages — queues the IMAP action only. The service layer
3000
- * (MailxService.moveMessages) owns the local DB mutation via
3001
- * updateMessageFolder; this method used to ALSO deleteMessage here,
3002
- * which wiped the row the service just updated — the message vanished
3003
- * on the next reconcile and "spam folder empty" was the symptom. */
3004
- async moveMessages(accountId: string, messages: { uid: number; folderId: number }[], targetFolderId: number): Promise<void> {
3005
- if (messages.length === 0) return;
3006
- for (const msg of messages) {
3007
- this.db.queueSyncAction(accountId, "move", msg.uid, msg.folderId, { targetFolderId });
3008
- }
3009
- console.log(` [move] ${accountId}: queued IMAP MOVE for ${messages.length} message(s) → folder ${targetFolderId}`);
3010
- this.debounceSyncActions(accountId);
3011
- }
3012
-
3013
- /** Debounced sync actions — batches rapid local changes into one IMAP operation */
3014
- private syncActionTimers = new Map<string, ReturnType<typeof setTimeout>>();
3015
-
3016
- private debounceSyncActions(accountId: string): void {
3017
- const existing = this.syncActionTimers.get(accountId);
3018
- if (existing) clearTimeout(existing);
3019
- this.syncActionTimers.set(accountId, setTimeout(() => {
3020
- this.syncActionTimers.delete(accountId);
3021
- this.processSyncActions(accountId).catch(() => {});
3022
- }, 1000));
3023
- }
3024
-
3025
- /** Move a message to Trash (delete) — local-first, queues IMAP sync */
3026
- async trashMessage(accountId: string, folderId: number, uid: number): Promise<void> {
3027
- const trash = this.findFolder(accountId, "trash");
3028
-
3029
- // Tombstone the Message-ID so sync won't re-import the row in the
3030
- // source folder before the server-side move completes. Cleared on
3031
- // permanent failure of the queued sync_action (see processSyncActions
3032
- // catch block, where clearTombstoneForUid runs after attempts >= 5)
3033
- // so the user sees the row reappear when their action didn't take.
3034
- const env = this.db.getMessageByUid(accountId, uid, folderId);
3035
- if (env?.messageId) this.db.addTombstone(accountId, env.messageId, env.subject || "");
3036
-
3037
- // Local first — move to trash folder so the row stays visible in
3038
- // Trash and Ctrl+Z can restore. Body file retained for undelete.
3039
- // If we're already in trash (or no trash configured), fall through
3040
- // to hard delete + EXPUNGE.
3041
- if (trash && trash.id !== folderId) {
3042
- this.db.moveMessageLocal(accountId, uid, folderId, trash.id);
3043
- } else {
3044
- this.unlinkBodyFile(accountId, uid, folderId).catch(() => {});
3045
- this.db.deleteMessage(accountId, uid, "user-initiated trash (already in trash → expunge)", "mailx-imap trashMessage");
3046
- }
3047
-
3048
- // Queue IMAP action + log the resolution so "I deleted a message and
3049
- // now it's in neither trash nor deleted" is diagnosable from the log.
3050
- if (trash && trash.id !== folderId) {
3051
- const trashFolder = this.db.getFolders(accountId).find(f => f.id === trash.id);
3052
- this.db.queueSyncAction(accountId, "move", uid, folderId, { targetFolderId: trash.id });
3053
- console.log(` [trash] ${accountId} UID ${uid}: queued MOVE to "${trashFolder?.path || trash.path}" (id=${trash.id}, specialUse=trash)`);
3054
- } else {
3055
- this.db.queueSyncAction(accountId, "delete", uid, folderId);
3056
- console.log(` [trash] ${accountId} UID ${uid}: queued EXPUNGE in folder ${folderId} (already in trash or no trash configured)`);
3057
- }
3058
-
3059
- // Folder counts moved — refresh both source and trash so the
3060
- // tree badges update immediately, not at the next sync.
3061
- this.db.recalcFolderCounts(folderId);
3062
- if (trash && trash.id !== folderId) this.db.recalcFolderCounts(trash.id);
3063
- this.emit("folderCountsChanged", accountId, {});
3064
-
3065
- // Debounced sync — batches multiple deletes into one IMAP session
3066
- this.debounceSyncActions(accountId);
3067
- }
3068
-
3069
- /** Move a message between folders — queues IMAP sync only. Service
3070
- * layer owns the local DB update (see MailxService.moveMessage). */
3071
- async moveMessage(accountId: string, uid: number, fromFolderId: number, toFolderId: number): Promise<void> {
3072
- this.db.queueSyncAction(accountId, "move", uid, fromFolderId, { targetFolderId: toFolderId });
3073
- console.log(` [move] ${accountId}: queued IMAP MOVE UID ${uid} folder ${fromFolderId} → ${toFolderId}`);
3074
- this.debounceSyncActions(accountId);
3075
- }
3076
-
3077
2964
  /** Move message across accounts using iflow's moveMessageToServer */
3078
2965
  async moveMessageCrossAccount(
3079
2966
  fromAccountId: string, uid: number, fromFolderId: number,
@@ -3102,55 +2989,6 @@ export class ImapManager extends EventEmitter {
3102
2989
  });
3103
2990
  }
3104
2991
 
3105
- /** Undelete — move from Trash back to original folder. Local-first:
3106
- * the row was moved (not deleted) on trash, so we just move it back
3107
- * in the local DB and reconcile the IMAP queue. Two cases:
3108
- * (a) the to-trash MOVE is still pending — cancel it; the server
3109
- * never saw the delete, so no counter-action is needed.
3110
- * (b) the to-trash MOVE drained — the message is now in Trash on
3111
- * the server with a new uid. Queue a counter-move from
3112
- * trash → original. The IMAP processor's fetchByUid in trash
3113
- * will use the local membership uid (which the reconciler
3114
- * rebound to the server's new trash uid via Message-ID match).
3115
- * If reconcile hasn't run yet (unlikely race), action retries
3116
- * until it does. */
3117
- async undeleteMessage(accountId: string, uid: number, originalFolderId: number): Promise<void> {
3118
- const trash = this.findFolder(accountId, "trash");
3119
- if (!trash) throw new Error("No Trash folder found");
3120
-
3121
- // Move locally back to the original folder.
3122
- const moved = this.db.moveMessageLocal(accountId, uid, trash.id, originalFolderId);
3123
- if (!moved) {
3124
- console.log(` [undelete] ${accountId} UID ${uid}: no row in trash — nothing to restore locally (sync may have already pruned)`);
3125
- }
3126
-
3127
- // (a) cancel still-pending to-trash action.
3128
- const pending = this.db.findPendingSyncAction(accountId, "move", uid, originalFolderId, trash.id);
3129
- if (pending) {
3130
- this.db.completeSyncAction(pending.id);
3131
- console.log(` [undelete] ${accountId} UID ${uid}: cancelled pending MOVE to trash (server never saw delete)`);
3132
- this.emit("folderCountsChanged", accountId, {});
3133
- return;
3134
- }
3135
-
3136
- // (b) queue counter-move from trash → original.
3137
- this.db.queueSyncAction(accountId, "move", uid, trash.id, { targetFolderId: originalFolderId });
3138
- console.log(` [undelete] ${accountId} UID ${uid}: queued counter-MOVE trash → folder ${originalFolderId}`);
3139
- this.debounceSyncActions(accountId);
3140
- this.emit("folderCountsChanged", accountId, {});
3141
- }
3142
-
3143
- /** Update flags — local-first, queues IMAP sync */
3144
- async updateFlagsLocal(accountId: string, uid: number, folderId: number, flags: string[]): Promise<void> {
3145
- this.db.updateMessageFlags(accountId, uid, flags);
3146
- this.db.queueSyncAction(accountId, "flags", uid, folderId, { flags });
3147
- // User-visible pink-dot pending state stays until the action drains.
3148
- // The 30-second periodic tick was too slow — opening one message to
3149
- // auto-mark-as-read left it pink for half a minute. Same 1-second
3150
- // debounce as moves/deletes batches rapid flag churn without the
3151
- // visual lag.
3152
- this.debounceSyncActions(accountId);
3153
- }
3154
2992
 
3155
2993
  /** Process pending sync actions for an account */
3156
2994
  async processSyncActions(accountId: string): Promise<void> {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bobfrankston/mailx-imap",
9
- "version": "0.1.44",
9
+ "version": "0.1.45",
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.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -201,6 +201,9 @@ export declare class MailxService implements MailxApi {
201
201
  /** End external editing. Stops the watcher, removes the temp file.
202
202
  * Caller is the compose UI when the user closes the window or sends. */
203
203
  closeWordEdit(editId: string): Promise<void>;
204
+ /** Toggle flags. Local DB write + Store event + server-mirror enqueue.
205
+ * No IMAP code path runs in the click→ack window — the queued drain
206
+ * fires 1s later, coalescing rapid toggles. */
204
207
  updateFlags(accountId: string, uid: number, flags: string[]): Promise<void>;
205
208
  allowRemoteContent(type: "sender" | "domain" | "recipient", value: string): Promise<void>;
206
209
  getUserDict(): Promise<string[]>;
@@ -350,9 +353,19 @@ export declare class MailxService implements MailxApi {
350
353
  /** Force re-authentication for an account (deletes token, opens browser consent) */
351
354
  reauthenticate(accountId: string): Promise<boolean>;
352
355
  send(msg: any): Promise<void>;
356
+ /** Trash a single message. Local-first: local row moves to Trash (or
357
+ * expunges if already there); the server mirror is queued. */
353
358
  deleteMessage(accountId: string, uid: number): Promise<void>;
359
+ /** Bulk trash. Same shape as deleteMessage but loops; each row gets its
360
+ * own pending-delete flag, local move/expunge, and queue entry. */
354
361
  deleteMessages(accountId: string, uids: number[]): Promise<void>;
362
+ /** Move a message to another folder. Same-account moves go through the
363
+ * Store + queue. Cross-account moves still synchronously bridge two
364
+ * IMAP connections (rare; local-first violation noted as future work). */
355
365
  moveMessage(accountId: string, uid: number, targetFolderId: number, targetAccountId?: string): Promise<void>;
366
+ /** Bulk move. Loops the single-move pattern under a withBatch so the
367
+ * one folder-counts re-render fires once per affected folder, not per
368
+ * message. */
356
369
  moveMessages(accountId: string, uids: number[], targetFolderId: number): Promise<void>;
357
370
  /** Move messages to the account's configured spam folder (accounts.jsonc "spam" path).
358
371
  * Throws if the account has no spam folder configured or the folder doesn't exist locally. */
@@ -372,6 +385,9 @@ export declare class MailxService implements MailxApi {
372
385
  ok: true;
373
386
  row: string;
374
387
  }>;
388
+ /** Restore from Trash. Local-first: move the row back, clear tombstone
389
+ * and pending-delete flag, then either retract the still-queued MOVE
390
+ * to trash or queue a counter-MOVE (trash → original). */
375
391
  undeleteMessage(accountId: string, uid: number, folderId: number): Promise<void>;
376
392
  deleteOnServer(accountId: string, folderPath: string, uid: number): Promise<void>;
377
393
  createFolder(accountId: string, parentPath: string, name: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,OAAO,EAAe,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,OAAO,KAAK,EAAiB,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAkB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwE3M,UAAU,gBAAgB;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB;AAID;;;;;yDAKyD;AACzD,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEzG,qBAAa,YAAa,YAAW,QAAQ;IAsCrC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,WAAW;IAnCvB,OAAO,CAAC,cAAc,CAAgC;IAItD,OAAO,CAAC,qBAAq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AAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CACjD"}
@@ -864,9 +864,14 @@ export class MailxService {
864
864
  }
865
865
  catch { /* file already gone — fine */ }
866
866
  }
867
+ /** Toggle flags. Local DB write + Store event + server-mirror enqueue.
868
+ * No IMAP code path runs in the click→ack window — the queued drain
869
+ * fires 1s later, coalescing rapid toggles. */
867
870
  async updateFlags(accountId, uid, flags) {
868
871
  const envelope = this.db.getMessageByUid(accountId, uid);
869
- await this.imapManager.updateFlagsLocal(accountId, uid, envelope?.folderId || 0, flags);
872
+ const folderId = envelope?.folderId || 0;
873
+ this.localStore.updateFlags(accountId, uid, folderId, flags);
874
+ this.syncQueue.enqueueFlag(accountId, uid, folderId, flags);
870
875
  }
871
876
  // ── Remote content allow-list ──
872
877
  async allowRemoteContent(type, value) {
@@ -1999,85 +2004,77 @@ export class MailxService {
1999
2004
  });
2000
2005
  }
2001
2006
  // ── Delete / Move / Undelete ──
2007
+ /** Trash a single message. Local-first: local row moves to Trash (or
2008
+ * expunges if already there); the server mirror is queued. */
2002
2009
  async deleteMessage(accountId, uid) {
2003
2010
  const envelope = this.db.getMessageByUid(accountId, uid);
2004
2011
  if (!envelope)
2005
2012
  throw new Error("Message not found");
2006
- // Mark as pending server-side delete. The row stays visible (struck
2007
- // through in the UI) until the IMAP MOVE-to-Trash / EXPUNGE confirms
2008
- // server-side. Replaces the old tombstone-by-Message-ID hack: server
2009
- // is authoritative, our flag tracks "in flight" state, not "hide
2010
- // from view." Undelete (Ctrl-Z) clears the flag.
2011
2013
  this.db.setMessagePendingDelete(accountId, uid, envelope.folderId);
2012
- await this.imapManager.trashMessage(accountId, envelope.folderId, envelope.uid);
2014
+ const trash = this.localStore.findSpecialFolder(accountId, "trash");
2015
+ const result = this.localStore.trashMessage(accountId, uid, envelope.folderId, trash?.id ?? null);
2016
+ if (result === "moved-to-trash" && trash) {
2017
+ this.syncQueue.enqueueMove(accountId, uid, envelope.folderId, trash.id);
2018
+ }
2019
+ else {
2020
+ this.syncQueue.enqueueDelete(accountId, uid, envelope.folderId, "delete");
2021
+ }
2013
2022
  }
2023
+ /** Bulk trash. Same shape as deleteMessage but loops; each row gets its
2024
+ * own pending-delete flag, local move/expunge, and queue entry. */
2014
2025
  async deleteMessages(accountId, uids) {
2015
- const messages = uids.map(uid => {
2016
- const env = this.db.getMessageByUid(accountId, uid);
2017
- if (!env)
2018
- return null;
2019
- this.db.setMessagePendingDelete(accountId, uid, env.folderId);
2020
- return { uid: env.uid, folderId: env.folderId };
2021
- }).filter(m => m !== null);
2022
- await this.imapManager.trashMessages(accountId, messages);
2026
+ const trash = this.localStore.findSpecialFolder(accountId, "trash");
2027
+ this.localStore.bus.withBatch(() => {
2028
+ for (const uid of uids) {
2029
+ const env = this.db.getMessageByUid(accountId, uid);
2030
+ if (!env)
2031
+ continue;
2032
+ this.db.setMessagePendingDelete(accountId, uid, env.folderId);
2033
+ const result = this.localStore.trashMessage(accountId, uid, env.folderId, trash?.id ?? null);
2034
+ if (result === "moved-to-trash" && trash) {
2035
+ this.syncQueue.enqueueMove(accountId, uid, env.folderId, trash.id);
2036
+ }
2037
+ else {
2038
+ this.syncQueue.enqueueDelete(accountId, uid, env.folderId, "delete");
2039
+ }
2040
+ }
2041
+ });
2023
2042
  }
2043
+ /** Move a message to another folder. Same-account moves go through the
2044
+ * Store + queue. Cross-account moves still synchronously bridge two
2045
+ * IMAP connections (rare; local-first violation noted as future work). */
2024
2046
  async moveMessage(accountId, uid, targetFolderId, targetAccountId) {
2047
+ if (targetAccountId && targetAccountId !== accountId) {
2048
+ // Cross-account: source row removed, body re-fetched on target
2049
+ // via the destination provider. Done synchronously today — moving
2050
+ // this onto the bus needs a two-sided outbound APPEND queue which
2051
+ // is out of scope for this refactor. Local DB cleanup still
2052
+ // happens via mailx-imap (see moveMessageCrossAccount).
2053
+ await this.imapManager.moveMessageCrossAccount(accountId, uid, this.db.getMessageByUid(accountId, uid)?.folderId || 0, targetAccountId, targetFolderId);
2054
+ return;
2055
+ }
2025
2056
  const envelope = this.db.getMessageByUid(accountId, uid);
2026
2057
  if (!envelope)
2027
2058
  throw new Error("Message not found");
2028
- // Tombstone before the local move so sync can't re-import the
2029
- // pre-move row into the source folder before IMAP MOVE completes.
2030
- // Cleared on terminal IMAP failure (see processSyncActions catch).
2031
- if (envelope.messageId)
2032
- this.db.addTombstone(accountId, envelope.messageId, envelope.subject || "");
2033
- // Local-first: move BOTH the legacy `messages.folder_id` AND the
2034
- // `message_folders` membership row so the user-visible list query
2035
- // (which joins through mf) reflects the move immediately. Pre-fix
2036
- // this used `updateMessageFolder` which only touched the legacy
2037
- // column; messages stayed visible in the source folder via the mf
2038
- // join and reappeared on the next refresh — symptom: "I marked
2039
- // them as spam and they came back."
2040
- const moved = this.db.moveMessageLocal(accountId, uid, envelope.folderId, targetFolderId);
2059
+ const moved = this.localStore.moveMessage(accountId, uid, envelope.folderId, targetFolderId);
2041
2060
  if (!moved)
2042
2061
  throw new Error(`Move failed: no row at (${accountId}, folder=${envelope.folderId}, uid=${uid})`);
2043
- this.db.recalcFolderCounts(envelope.folderId);
2044
- this.db.recalcFolderCounts(targetFolderId);
2045
- // Sync to server in background
2046
- if (targetAccountId && targetAccountId !== accountId) {
2047
- this.imapManager.moveMessageCrossAccount(accountId, envelope.uid, envelope.folderId, targetAccountId, targetFolderId).catch(e => console.error(` Move sync failed: ${e.message}`));
2048
- }
2049
- else {
2050
- this.imapManager.moveMessage(accountId, envelope.uid, envelope.folderId, targetFolderId).catch(e => console.error(` Move sync failed: ${e.message}`));
2051
- }
2062
+ this.syncQueue.enqueueMove(accountId, uid, envelope.folderId, targetFolderId);
2052
2063
  }
2064
+ /** Bulk move. Loops the single-move pattern under a withBatch so the
2065
+ * one folder-counts re-render fires once per affected folder, not per
2066
+ * message. */
2053
2067
  async moveMessages(accountId, uids, targetFolderId) {
2054
- const messages = uids.map(uid => {
2055
- const env = this.db.getMessageByUid(accountId, uid);
2056
- if (!env)
2057
- return null;
2058
- // Tombstone before the local move so sync can't re-import the
2059
- // pre-move row into the source folder before the IMAP MOVE
2060
- // completes (server still sees it there until then). Cleared
2061
- // on terminal IMAP failure (see processSyncActions catch
2062
- // block) so the row reappears when the action didn't take.
2063
- if (env.messageId)
2064
- this.db.addTombstone(accountId, env.messageId, env.subject || "");
2065
- return { uid: env.uid, folderId: env.folderId };
2066
- }).filter(m => m !== null);
2067
- // Local-first move via mf-aware helper. See moveMessage() above for
2068
- // why updateMessageFolder isn't sufficient.
2069
- const sourceFolderIds = new Set();
2070
- for (const msg of messages) {
2071
- if (msg) {
2072
- this.db.moveMessageLocal(accountId, msg.uid, msg.folderId, targetFolderId);
2073
- sourceFolderIds.add(msg.folderId);
2074
- }
2075
- }
2076
- for (const fid of sourceFolderIds)
2077
- this.db.recalcFolderCounts(fid);
2078
- this.db.recalcFolderCounts(targetFolderId);
2079
- // Sync to server in background
2080
- this.imapManager.moveMessages(accountId, messages, targetFolderId).catch(e => console.error(` Move sync failed: ${e.message}`));
2068
+ this.localStore.bus.withBatch(() => {
2069
+ for (const uid of uids) {
2070
+ const env = this.db.getMessageByUid(accountId, uid);
2071
+ if (!env)
2072
+ continue;
2073
+ if (!this.localStore.moveMessage(accountId, uid, env.folderId, targetFolderId))
2074
+ continue;
2075
+ this.syncQueue.enqueueMove(accountId, uid, env.folderId, targetFolderId);
2076
+ }
2077
+ });
2081
2078
  }
2082
2079
  /** Move messages to the account's configured spam folder (accounts.jsonc "spam" path).
2083
2080
  * Throws if the account has no spam folder configured or the folder doesn't exist locally. */
@@ -2148,18 +2145,26 @@ export class MailxService {
2148
2145
  console.log(` [spam] reported ${accountId}/${uid} → spam.csv`);
2149
2146
  return { ok: true, row };
2150
2147
  }
2148
+ /** Restore from Trash. Local-first: move the row back, clear tombstone
2149
+ * and pending-delete flag, then either retract the still-queued MOVE
2150
+ * to trash or queue a counter-MOVE (trash → original). */
2151
2151
  async undeleteMessage(accountId, uid, folderId) {
2152
- // Clear both the tombstone (so sync re-imports the row if the
2153
- // server still has it) AND the pending_delete flag (visible-state
2154
- // marker). The IMAP undelete (UID STORE -FLAGS \Deleted /
2155
- // move-back) is queued by the imapManager call; if the server
2156
- // already EXPUNGEd the message, the row is gone anyway and these
2157
- // clears are no-ops.
2158
- const envelope = this.db.getMessageByUid(accountId, uid, folderId);
2152
+ const trash = this.localStore.findSpecialFolder(accountId, "trash");
2153
+ if (!trash)
2154
+ throw new Error("No Trash folder configured");
2155
+ // Clear bookkeeping flags before the local move so a re-sync mid-flight
2156
+ // can't re-mark the row as pending-delete and re-tombstone it.
2157
+ const envelope = this.db.getMessageByUid(accountId, uid, trash.id);
2159
2158
  if (envelope?.messageId)
2160
2159
  this.db.removeTombstone(accountId, envelope.messageId);
2161
- this.db.clearMessagePendingDelete(accountId, uid, folderId);
2162
- await this.imapManager.undeleteMessage(accountId, uid, folderId);
2160
+ this.db.clearMessagePendingDelete(accountId, uid, trash.id);
2161
+ this.localStore.undeleteMessage(accountId, uid, trash.id, folderId);
2162
+ // (a) MOVE to trash still queued? retract it — server never saw the
2163
+ // delete, no counter-action needed. (b) Already drained → queue
2164
+ // the counter-MOVE so server state catches up.
2165
+ if (!this.syncQueue.cancelPendingMove(accountId, uid, folderId, trash.id)) {
2166
+ this.syncQueue.enqueueMove(accountId, uid, trash.id, folderId);
2167
+ }
2163
2168
  }
2164
2169
  async deleteOnServer(accountId, folderPath, uid) {
2165
2170
  await this.imapManager.deleteOnServer(accountId, folderPath, uid);
@@ -2364,12 +2369,19 @@ export class MailxService {
2364
2369
  for (const child of children) {
2365
2370
  await this.spillFolderContentsToTrash(accountId, child, trash, client);
2366
2371
  }
2367
- // Move messages to Trash root. Reuse existing trashMessages path so
2368
- // body files / sync queue / count refresh all behave consistently.
2372
+ // Move messages to Trash root via the Store + queue. withBatch
2373
+ // coalesces folder-count events into one re-render per topic.
2369
2374
  const uids = await client.getUids(folder.path).catch(() => []);
2370
2375
  if (uids.length > 0) {
2371
- const messages = uids.map((uid) => ({ uid, folderId: folder.id }));
2372
- await this.imapManager.trashMessages(accountId, messages);
2376
+ this.localStore.bus.withBatch(() => {
2377
+ for (const uid of uids) {
2378
+ const result = this.localStore.trashMessage(accountId, uid, folder.id, trash.id);
2379
+ if (result === "moved-to-trash")
2380
+ this.syncQueue.enqueueMove(accountId, uid, folder.id, trash.id);
2381
+ else
2382
+ this.syncQueue.enqueueDelete(accountId, uid, folder.id, "delete");
2383
+ }
2384
+ });
2373
2385
  }
2374
2386
  // Folder should now be empty; delete it on the server.
2375
2387
  try {