@bobfrankston/mailx-imap 0.1.87 → 0.1.88
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/index.js +16 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2664,6 +2664,22 @@ export class ImapManager extends EventEmitter {
|
|
|
2664
2664
|
clearTimeout(expungeTimer);
|
|
2665
2665
|
expungeTimer = setTimeout(() => {
|
|
2666
2666
|
expungeTimer = null;
|
|
2667
|
+
// Skip while WE have sync actions draining. Every
|
|
2668
|
+
// delete/move we push EXPUNGEs on the server and bounces
|
|
2669
|
+
// straight back here as an onExpunge — and a reconcile
|
|
2670
|
+
// of a large INBOX is a full server-vs-local set-diff.
|
|
2671
|
+
// During a bulk delete that meant one ~135k-row reconcile
|
|
2672
|
+
// per message (the 2s debounce can't coalesce them — our
|
|
2673
|
+
// moves arrive ~2.5s apart), hammering the DB so the list
|
|
2674
|
+
// sat on "Loading…" with a stale preview (Bob 2026-06-12).
|
|
2675
|
+
// The local store already reflects our own moves, so these
|
|
2676
|
+
// are redundant. The last move empties the queue, so its
|
|
2677
|
+
// trailing expunge runs exactly ONE reconcile to catch any
|
|
2678
|
+
// genuinely-external change.
|
|
2679
|
+
if (this.db.getPendingSyncActions(accountId).length > 0) {
|
|
2680
|
+
console.log(` [idle] ${accountId}: INBOX expunge during own drain — deferring reconcile`);
|
|
2681
|
+
return;
|
|
2682
|
+
}
|
|
2667
2683
|
const inbox = this.db.getFolders(accountId).find(f => f.specialUse === "inbox");
|
|
2668
2684
|
if (!inbox)
|
|
2669
2685
|
return;
|