@bobfrankston/mailx-imap 0.1.117 → 0.1.118

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 +13 -0
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -4508,9 +4508,11 @@ export class ImapManager extends EventEmitter {
4508
4508
  // seem to still leave it in draft so I don't know if it has been
4509
4509
  // sent or not. Once you hand it off it must leave draft."
4510
4510
  let localDeletedUid = 0;
4511
+ let localDeletedUuid;
4511
4512
  if (draftUid) {
4512
4513
  const existing = this.db.getMessageByUid(accountId, draftUid, drafts.id);
4513
4514
  if (existing) {
4515
+ localDeletedUuid = existing.uuid;
4514
4516
  this.unlinkBodyFile(accountId, draftUid, drafts.id).catch(() => { });
4515
4517
  this.db.deleteMessage(accountId, drafts.id, draftUid, "user sent the message (draft cleanup)", "mailx-imap deleteDraft (local)");
4516
4518
  localDeletedUid = draftUid;
@@ -4527,6 +4529,17 @@ export class ImapManager extends EventEmitter {
4527
4529
  if (localDeletedUid > 0) {
4528
4530
  this.db.recalcFolderCounts(drafts.id);
4529
4531
  this.emit("folderCountsChanged", accountId, {});
4532
+ // messageRemoved drives the list's remove-stale flow AND the
4533
+ // viewer clear. Without it, discarding a draft that was open in
4534
+ // the preview pane left it displayed after the row vanished
4535
+ // (Bob 2026-07-18: "I discarded a message but it is still
4536
+ // showing in preview"). Same shape the reconciler publishes on
4537
+ // server-side EXPUNGE.
4538
+ storeBus.publish({
4539
+ topic: localDeletedUuid ? `message:${localDeletedUuid}` : `folder:${drafts.id}`,
4540
+ kind: "messageRemoved",
4541
+ accountId, folderId: drafts.id, uid: localDeletedUid, msgUuid: localDeletedUuid,
4542
+ });
4530
4543
  }
4531
4544
  let succeeded = false;
4532
4545
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.117",
3
+ "version": "0.1.118",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "@bobfrankston/mailx-types": "^0.1.24",
13
13
  "@bobfrankston/mailx-settings": "^0.1.35",
14
14
  "@bobfrankston/mailx-store": "^0.1.58",
15
- "@bobfrankston/iflow-direct": "^0.1.56",
15
+ "@bobfrankston/iflow-direct": "^0.1.59",
16
16
  "@bobfrankston/tcp-transport": "^0.1.8",
17
17
  "@bobfrankston/smtp-direct": "^0.1.9",
18
18
  "@bobfrankston/mailx-sync": "^0.1.27",
@@ -40,7 +40,7 @@
40
40
  "@bobfrankston/mailx-types": "^0.1.24",
41
41
  "@bobfrankston/mailx-settings": "^0.1.35",
42
42
  "@bobfrankston/mailx-store": "^0.1.58",
43
- "@bobfrankston/iflow-direct": "^0.1.56",
43
+ "@bobfrankston/iflow-direct": "^0.1.59",
44
44
  "@bobfrankston/tcp-transport": "^0.1.8",
45
45
  "@bobfrankston/smtp-direct": "^0.1.9",
46
46
  "@bobfrankston/mailx-sync": "^0.1.27",