@bobfrankston/mailx-store 0.1.54 → 0.1.55
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/db.d.ts +14 -0
- package/db.js +20 -0
- package/package.json +3 -3
package/db.d.ts
CHANGED
|
@@ -435,6 +435,20 @@ export declare class MailxDB {
|
|
|
435
435
|
* here but NOT on the server gets its membership dropped (which
|
|
436
436
|
* may then GC the messages row if it has no other folders). */
|
|
437
437
|
getUidsForFolder(_accountId: string, folderId: number): number[];
|
|
438
|
+
/** UIDs we actually have a stored MESSAGE ROW for in this folder — from the
|
|
439
|
+
* `messages` table, NOT `message_folders`. The two can diverge: an "orphan
|
|
440
|
+
* membership" (a message_folders row whose messages row was never written /
|
|
441
|
+
* got deleted) makes getUidsForFolder report a UID we don't truly have.
|
|
442
|
+
* The set-diff backfill must diff against THIS so it re-fetches the real
|
|
443
|
+
* message data for orphans instead of treating them as present (Bob
|
|
444
|
+
* 2026-06-20: ~1k old INBOX messages stuck missing — membership said
|
|
445
|
+
* "have it", the row didn't exist). */
|
|
446
|
+
getStoredUids(accountId: string, folderId: number): number[];
|
|
447
|
+
/** Count of stored MESSAGE ROWS in a folder (messages table). The deficit
|
|
448
|
+
* gate compares this to the server's count to decide whether to reconcile;
|
|
449
|
+
* using the messages table (not message_folders) means orphan memberships
|
|
450
|
+
* don't mask a real "rows are missing" deficit. */
|
|
451
|
+
getStoredCount(accountId: string, folderId: number): number;
|
|
438
452
|
/** List recent rows in a folder for a Sent-sweep / reconciliation pass.
|
|
439
453
|
* Returns only the columns the sweeper needs (uid, message_id, date,
|
|
440
454
|
* subject, size, has_attachments, preview, body_path) for every row in
|
package/db.js
CHANGED
|
@@ -2394,6 +2394,26 @@ export class MailxDB {
|
|
|
2394
2394
|
const rows = this.db.prepare("SELECT uid FROM message_folders WHERE folder_id = ?").all(folderId);
|
|
2395
2395
|
return rows.map(r => r.uid);
|
|
2396
2396
|
}
|
|
2397
|
+
/** UIDs we actually have a stored MESSAGE ROW for in this folder — from the
|
|
2398
|
+
* `messages` table, NOT `message_folders`. The two can diverge: an "orphan
|
|
2399
|
+
* membership" (a message_folders row whose messages row was never written /
|
|
2400
|
+
* got deleted) makes getUidsForFolder report a UID we don't truly have.
|
|
2401
|
+
* The set-diff backfill must diff against THIS so it re-fetches the real
|
|
2402
|
+
* message data for orphans instead of treating them as present (Bob
|
|
2403
|
+
* 2026-06-20: ~1k old INBOX messages stuck missing — membership said
|
|
2404
|
+
* "have it", the row didn't exist). */
|
|
2405
|
+
getStoredUids(accountId, folderId) {
|
|
2406
|
+
const rows = this.db.prepare("SELECT uid FROM messages WHERE account_id = ? AND folder_id = ?").all(accountId, folderId);
|
|
2407
|
+
return rows.map(r => r.uid);
|
|
2408
|
+
}
|
|
2409
|
+
/** Count of stored MESSAGE ROWS in a folder (messages table). The deficit
|
|
2410
|
+
* gate compares this to the server's count to decide whether to reconcile;
|
|
2411
|
+
* using the messages table (not message_folders) means orphan memberships
|
|
2412
|
+
* don't mask a real "rows are missing" deficit. */
|
|
2413
|
+
getStoredCount(accountId, folderId) {
|
|
2414
|
+
const r = this.db.prepare("SELECT count(*) as cnt FROM messages WHERE account_id = ? AND folder_id = ?").get(accountId, folderId);
|
|
2415
|
+
return r?.cnt || 0;
|
|
2416
|
+
}
|
|
2397
2417
|
/** List recent rows in a folder for a Sent-sweep / reconciliation pass.
|
|
2398
2418
|
* Returns only the columns the sweeper needs (uid, message_id, date,
|
|
2399
2419
|
* subject, size, has_attachments, preview, body_path) for every row in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx-store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bobfrankston/mailx-types": "^0.1.19",
|
|
13
|
-
"@bobfrankston/mailx-settings": "^0.1.
|
|
13
|
+
"@bobfrankston/mailx-settings": "^0.1.30",
|
|
14
14
|
"@bobfrankston/mailx-bus": "^0.1.2",
|
|
15
15
|
"mailparser": "^3.7.2"
|
|
16
16
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
".transformedSnapshot": {
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@bobfrankston/mailx-types": "^0.1.19",
|
|
33
|
-
"@bobfrankston/mailx-settings": "^0.1.
|
|
33
|
+
"@bobfrankston/mailx-settings": "^0.1.30",
|
|
34
34
|
"@bobfrankston/mailx-bus": "^0.1.2",
|
|
35
35
|
"mailparser": "^3.7.2"
|
|
36
36
|
}
|