@bobfrankston/mailx-imap 0.1.60 → 0.1.61

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.
Files changed (2) hide show
  1. package/index.js +24 -2
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -4449,7 +4449,19 @@ export class ImapManager extends EventEmitter {
4449
4449
  return;
4450
4450
  let reconciled = 0;
4451
4451
  let appended = 0;
4452
- await this.withConnection(accountId, async (client) => {
4452
+ // Use a DEDICATED IMAP client for sent-sweep — do NOT share the
4453
+ // slow-lane ops client. The priority-INBOX sync grabs the slow-lane
4454
+ // client via getOpsClient() (no lane queueing) and runs SEARCH→FETCH
4455
+ // as a logical transaction; if sent-sweep's searchByHeader (SELECT
4456
+ // Sent → SEARCH → CLOSE) interleaves on the same wire between the
4457
+ // sync's SEARCH and FETCH, the FETCH lands with no mailbox selected
4458
+ // and Dovecot returns "BAD No mailbox selected" — new mail never
4459
+ // lands locally (Bob 2026-05-25: "not seeing recent mail").
4460
+ // iflow-direct serializes per-command, not per-task, so reusing the
4461
+ // shared client is unsafe across logical transactions. A dedicated
4462
+ // client is the smallest surgical fix.
4463
+ const client = await this.createClientWithLimit(accountId);
4464
+ try {
4453
4465
  for (const row of rows) {
4454
4466
  const msgId = row.message_id;
4455
4467
  if (!msgId)
@@ -4493,7 +4505,17 @@ export class ImapManager extends EventEmitter {
4493
4505
  }
4494
4506
  }
4495
4507
  }
4496
- }, { slow: true, timeoutMs: 120_000 });
4508
+ }
4509
+ finally {
4510
+ try {
4511
+ await (client._realLogout || client.logout)();
4512
+ }
4513
+ catch { /* */ }
4514
+ try {
4515
+ client.destroy?.();
4516
+ }
4517
+ catch { /* */ }
4518
+ }
4497
4519
  if (reconciled + appended > 0) {
4498
4520
  this.emit("folderCountsChanged", accountId, {});
4499
4521
  console.log(` [sent-sweep] ${accountId}: ${reconciled} rebound, ${appended} re-appended`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-imap",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@bobfrankston/mailx-types": "^0.1.18",
13
13
  "@bobfrankston/mailx-settings": "^0.1.22",
14
- "@bobfrankston/mailx-store": "^0.1.36",
14
+ "@bobfrankston/mailx-store": "^0.1.37",
15
15
  "@bobfrankston/iflow-direct": "^0.1.50",
16
16
  "@bobfrankston/tcp-transport": "^0.1.6",
17
17
  "@bobfrankston/smtp-direct": "^0.1.8",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@bobfrankston/mailx-types": "^0.1.18",
41
41
  "@bobfrankston/mailx-settings": "^0.1.22",
42
- "@bobfrankston/mailx-store": "^0.1.36",
42
+ "@bobfrankston/mailx-store": "^0.1.37",
43
43
  "@bobfrankston/iflow-direct": "^0.1.50",
44
44
  "@bobfrankston/tcp-transport": "^0.1.6",
45
45
  "@bobfrankston/smtp-direct": "^0.1.8",