@bobfrankston/rmfmail 1.0.693 → 1.0.695
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/client/app.bundle.js +25 -23
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +24 -21
- package/client/app.js.map +1 -1
- package/client/app.ts +23 -19
- package/client/components/message-list.js +17 -7
- package/client/components/message-list.js.map +1 -1
- package/client/components/message-list.ts +14 -6
- package/package.json +1 -1
- package/packages/mailx-service/local-store.d.ts.map +1 -1
- package/packages/mailx-service/local-store.js +17 -1
- package/packages/mailx-service/local-store.js.map +1 -1
- package/packages/mailx-service/local-store.ts +19 -2
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-16972 → node_modules.npmglobalize-stash-36352}/.package-lock.json +0 -0
package/client/app.js
CHANGED
|
@@ -1357,28 +1357,31 @@ async function spamSelectedMessages() {
|
|
|
1357
1357
|
// sync is a background detail, the user's action should feel instant.
|
|
1358
1358
|
const snapshot = [...selected];
|
|
1359
1359
|
removeMessagesAndReconcile(selected);
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
statusSync.textContent = `Spam: ${snapshot.length} queued — pending server sync`;
|
|
1360
|
+
// Fire-and-forget per local-first: the optimistic remove above has
|
|
1361
|
+
// already updated the UI; the service-side move is sync DB + queued
|
|
1362
|
+
// IMAP. An IPC 120s timeout here doesn't mean the move failed — it
|
|
1363
|
+
// means the response is stuck behind a long-running prior op (e.g.
|
|
1364
|
+
// simpleParser blocking the event loop). The local commit and server
|
|
1365
|
+
// sync still happen. Surfacing it as a failure with an alert lies to
|
|
1366
|
+
// the user; the next folder reload reconciles either way.
|
|
1367
|
+
const byAccount = new Map();
|
|
1368
|
+
for (const msg of snapshot) {
|
|
1369
|
+
const uids = byAccount.get(msg.accountId) || [];
|
|
1370
|
+
uids.push(msg.uid);
|
|
1371
|
+
byAccount.set(msg.accountId, uids);
|
|
1373
1372
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1373
|
+
if (statusSync)
|
|
1374
|
+
statusSync.textContent = `Spam: ${snapshot.length} queued — pending server sync`;
|
|
1375
|
+
for (const [accountId, uids] of byAccount) {
|
|
1376
|
+
markAsSpamMessages(accountId, uids)
|
|
1377
|
+
.then(result => {
|
|
1378
|
+
console.log(`[spam] ${accountId}: moved ${result?.moved ?? uids.length} to folderId=${result?.targetFolderId}`);
|
|
1379
|
+
})
|
|
1380
|
+
.catch(e => {
|
|
1381
|
+
console.error(`[spam] ${accountId} failed:`, e);
|
|
1382
|
+
if (statusSync)
|
|
1383
|
+
statusSync.textContent = `Spam sync issue (${accountId}): ${e?.message || e}`;
|
|
1384
|
+
});
|
|
1382
1385
|
}
|
|
1383
1386
|
}
|
|
1384
1387
|
document.getElementById("btn-spam")?.addEventListener("click", spamSelectedMessages);
|