@bobfrankston/mailx 1.0.366 → 1.0.370
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.370",
|
|
4
4
|
"description": "Local-first email client with IMAP sync and standalone native app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/mailx.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@bobfrankston/iflow-node": "^0.1.7",
|
|
25
25
|
"@bobfrankston/miscinfo": "^1.0.9",
|
|
26
26
|
"@bobfrankston/oauthsupport": "^1.0.24",
|
|
27
|
-
"@bobfrankston/msger": "^0.1.
|
|
27
|
+
"@bobfrankston/msger": "^0.1.345",
|
|
28
28
|
"@bobfrankston/mailx-host": "^0.1.4",
|
|
29
29
|
"@capacitor/android": "^8.3.0",
|
|
30
30
|
"@capacitor/cli": "^8.3.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@bobfrankston/iflow-node": "^0.1.7",
|
|
89
89
|
"@bobfrankston/miscinfo": "^1.0.9",
|
|
90
90
|
"@bobfrankston/oauthsupport": "^1.0.24",
|
|
91
|
-
"@bobfrankston/msger": "^0.1.
|
|
91
|
+
"@bobfrankston/msger": "^0.1.345",
|
|
92
92
|
"@bobfrankston/mailx-host": "^0.1.4",
|
|
93
93
|
"@capacitor/android": "^8.3.0",
|
|
94
94
|
"@capacitor/cli": "^8.3.0",
|
|
@@ -58,7 +58,6 @@ export declare function getMessage(params: {
|
|
|
58
58
|
folderName?: string;
|
|
59
59
|
uid: number;
|
|
60
60
|
uuid?: string;
|
|
61
|
-
pending?: boolean;
|
|
62
61
|
messageId: string;
|
|
63
62
|
inReplyTo: string;
|
|
64
63
|
references: string[];
|
|
@@ -74,6 +73,7 @@ export declare function getMessage(params: {
|
|
|
74
73
|
preview: string;
|
|
75
74
|
bodyPath?: string;
|
|
76
75
|
providerId?: string;
|
|
76
|
+
pending?: boolean;
|
|
77
77
|
}>;
|
|
78
78
|
export declare function updateFlags(params: {
|
|
79
79
|
accountId: string;
|
|
@@ -827,6 +827,14 @@ export class MailxService {
|
|
|
827
827
|
if (!folder)
|
|
828
828
|
throw new Error("Folder not found");
|
|
829
829
|
this.db.deleteAllMessages(accountId, folderId);
|
|
830
|
+
// Recalc + broadcast so the folder-tree badge drops to 0 immediately.
|
|
831
|
+
// Without this, the badge kept showing the old unread count even
|
|
832
|
+
// though the list was empty (user-reported bug).
|
|
833
|
+
this.db.recalcFolderCounts(folderId);
|
|
834
|
+
try {
|
|
835
|
+
this.imapManager.emit?.("folderCountsChanged", accountId, {});
|
|
836
|
+
}
|
|
837
|
+
catch { /* non-fatal */ }
|
|
830
838
|
const client = this.imapManager.createPublicClient(accountId);
|
|
831
839
|
try {
|
|
832
840
|
const uids = await client.getUids(folder.path);
|
|
@@ -654,6 +654,18 @@ export class MailxDB {
|
|
|
654
654
|
this.db.prepare("UPDATE messages SET flags_json = ? WHERE account_id = ? AND uid = ?").run(JSON.stringify(flags), accountId, uid);
|
|
655
655
|
}
|
|
656
656
|
updateMessageFolder(accountId, uid, targetFolderId) {
|
|
657
|
+
// Idempotency: if a row already exists at (account, target_folder, uid)
|
|
658
|
+
// — common with Gmail's hash-synthesized UIDs across labels, or any
|
|
659
|
+
// case where the move was already partially applied — the UPDATE
|
|
660
|
+
// would fail the (acct, folder, uid) unique constraint. Treat it as
|
|
661
|
+
// a no-op: drop the source row, the message is already where the
|
|
662
|
+
// user wants it. Previously surfaced as "Mark-as-spam failed: UNIQUE
|
|
663
|
+
// constraint failed" — bad UX for what is logically already done.
|
|
664
|
+
const existingTarget = this.db.prepare("SELECT id FROM messages WHERE account_id = ? AND folder_id = ? AND uid = ?").get(accountId, targetFolderId, uid);
|
|
665
|
+
if (existingTarget) {
|
|
666
|
+
this.db.prepare("DELETE FROM messages WHERE account_id = ? AND uid = ? AND folder_id != ?").run(accountId, uid, targetFolderId);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
657
669
|
this.db.prepare("UPDATE messages SET folder_id = ? WHERE account_id = ? AND uid = ?").run(targetFolderId, accountId, uid);
|
|
658
670
|
}
|
|
659
671
|
updateBodyPath(accountId, uid, bodyPath) {
|