@bobfrankston/rmfmail 1.2.73 → 1.2.75
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 +3 -3
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +16 -1
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +16 -1
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +1 -0
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +1 -0
- package/packages/mailx-store/db.d.ts.map +1 -1
- package/packages/mailx-store/db.js +20 -1
- package/packages/mailx-store/db.js.map +1 -1
- package/packages/mailx-store/db.ts +22 -3
- package/packages/mailx-types/package.json +1 -1
|
@@ -2393,9 +2393,28 @@ export class MailxDB {
|
|
|
2393
2393
|
* for code paths that mean it; everyone else must pass folderId. */
|
|
2394
2394
|
updateMessageFlags(accountId: string, folderId: number | null, uid: number, flags: string[]): void {
|
|
2395
2395
|
if (folderId != null) {
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2396
|
+
// Resolve the row via its folder MEMBERSHIP, not messages.folder_id.
|
|
2397
|
+
// The message-id collapse (upsertMessage move-detect) keeps ONE
|
|
2398
|
+
// `messages` row per message_id whose `folder_id` is an arbitrary
|
|
2399
|
+
// "primary" folder, while the message appears in OTHER folders via
|
|
2400
|
+
// `message_folders`. A `WHERE folder_id = ?` update therefore MISSED
|
|
2401
|
+
// any message viewed in a folder other than its stored primary —
|
|
2402
|
+
// 0 rows changed, so star/mark-read silently did nothing locally and
|
|
2403
|
+
// the change "came right back" on the next render (Bob 2026-06-27).
|
|
2404
|
+
// Match the membership (the same join getMessageByUid uses).
|
|
2405
|
+
const r = this.db.prepare(`
|
|
2406
|
+
UPDATE messages SET flags_json = ? WHERE id = (
|
|
2407
|
+
SELECT m.id FROM messages m
|
|
2408
|
+
JOIN message_folders mf ON mf.message_row_id = m.id
|
|
2409
|
+
WHERE m.account_id = ? AND mf.folder_id = ? AND mf.uid = ? LIMIT 1
|
|
2410
|
+
)
|
|
2411
|
+
`).run(JSON.stringify(flags), accountId, folderId, uid);
|
|
2412
|
+
// Fallback for any legacy row lacking a membership entry.
|
|
2413
|
+
if (r.changes === 0) {
|
|
2414
|
+
this.db.prepare(
|
|
2415
|
+
"UPDATE messages SET flags_json = ? WHERE account_id = ? AND folder_id = ? AND uid = ?"
|
|
2416
|
+
).run(JSON.stringify(flags), accountId, folderId, uid);
|
|
2417
|
+
}
|
|
2399
2418
|
} else {
|
|
2400
2419
|
this.db.prepare(
|
|
2401
2420
|
"UPDATE messages SET flags_json = ? WHERE account_id = ? AND uid = ?"
|