proton-mail-bridge-client 1.19.0 → 1.19.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAA2E,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC/I,OAAO,EAAkB,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAUV,WAAW,EAEX,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAsqD1B,eAAO,MAAM,eAAe,aAyB1B,CAAC;AAgGH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAwBZ;AAmED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3G;AAKD,wBAAgB,0BAA0B,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,CAAC,EA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,CAgGrD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgzFP;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAqD1C"}
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import { BackgroundSyncService } from "./services/background-sync-service.js";
15
15
  import { DeliveryQueueService } from "./services/delivery-queue-service.js";
16
16
  import { DraftStoreService } from "./services/draft-store-service.js";
17
17
  import { LocalIndexService } from "./services/local-index-service.js";
18
- import { describeImapError, isLikelyAuthenticationError, isLikelyConnectionError, SimpleIMAPService } from "./services/simple-imap-service.js";
18
+ import { BULK_ITEM_TIMEOUT_MS, describeImapError, isLikelyAuthenticationError, isLikelyConnectionError, SimpleIMAPService } from "./services/simple-imap-service.js";
19
19
  import { applySignature, SMTPService } from "./services/smtp-service.js";
20
20
  import { SnoozeService } from "./services/snooze-service.js";
21
21
  import { TemplateService } from "./services/template-service.js";
@@ -2409,9 +2409,17 @@ function emailSourceFromActionResult(result) {
2409
2409
  async function applyBatchEmailAction(imapService, entries, input) {
2410
2410
  for (const emailId of input.emailIds) {
2411
2411
  try {
2412
- const result = input.dryRun
2413
- ? await previewEmailAction(imapService, emailId, input.action, input.targetFolder)
2414
- : await runEmailAction(imapService, emailId, input.action, input.targetFolder);
2412
+ // Unlike SimpleIMAPService's own bulk*/thread* loops, this one had no
2413
+ // per-item bound — a single wedged IMAP call (same shared connection,
2414
+ // same churn from the perpetual IDLE watcher) hung the *entire*
2415
+ // tools/call response forever, with no timeout to degrade it to a
2416
+ // per-item failure. Reused verbatim rather than duplicated, since it
2417
+ // also forces the same reconnect-on-timeout SimpleIMAPService's other
2418
+ // callers rely on to keep the item after it from wedging too.
2419
+ const action = input.dryRun
2420
+ ? previewEmailAction(imapService, emailId, input.action, input.targetFolder)
2421
+ : runEmailAction(imapService, emailId, input.action, input.targetFolder);
2422
+ const result = await imapService.withTimeout(action, BULK_ITEM_TIMEOUT_MS, `Timed out after ${BULK_ITEM_TIMEOUT_MS}ms running ${input.action} on ${emailId}`);
2415
2423
  entries.push({
2416
2424
  emailId,
2417
2425
  ok: true,
@@ -4419,7 +4427,15 @@ export function createServer(config, options = {}) {
4419
4427
  const idleProbe = includeIdleProbe
4420
4428
  ? await Promise.allSettled([
4421
4429
  imapService.waitForMailboxChanges({
4422
- folder: config.runtime.autoSyncFolder,
4430
+ // autoSyncFolder is a comma-separated list ("INBOX,Sent") for
4431
+ // the periodic index sync, but IMAP IDLE can only watch one
4432
+ // mailbox per connection (same constraint documented on
4433
+ // BackgroundSyncService's primaryIdleFolder). Passing the raw
4434
+ // multi-folder string through made every run_doctor
4435
+ // includeIdleProbe:true call try to SELECT a literal mailbox
4436
+ // named "INBOX,Sent" and fail — reproduced live, 100% of the
4437
+ // time with the default config.
4438
+ folder: config.runtime.autoSyncFolder?.split(",")[0]?.trim() || "INBOX",
4423
4439
  timeoutMs: idleTimeoutSeconds * 1000,
4424
4440
  }),
4425
4441
  ]).then(([result]) => result)
@@ -4486,6 +4502,11 @@ export function createServer(config, options = {}) {
4486
4502
  ? idleProbe.reason.message
4487
4503
  : String(idleProbe.reason)
4488
4504
  : "IMAP connection failed.",
4505
+ // smtp/imap above both attach this; idleProbe never did,
4506
+ // so an idle-specific failure (e.g. the wrong-folder bug
4507
+ // just fixed above) gave no actionable next step despite
4508
+ // this tool's own description promising one.
4509
+ diagnosis: diagnoseFailure(idleProbe.reason),
4489
4510
  },
4490
4511
  backgroundSync: backgroundSyncService.getStatus(),
4491
4512
  index: indexStatus,