proton-mail-bridge-client 1.19.1 → 1.19.3

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,EAAiG,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACrK,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,EAA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,CAgGrD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAg0FP;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAqD1C"}
package/dist/index.js CHANGED
@@ -3718,6 +3718,17 @@ export function createServer(config, options = {}) {
3718
3718
  if (draft.status === "sent") {
3719
3719
  throw new McpError(ErrorCode.InvalidParams, `Draft ${draft.id} was already sent — scheduling it again would deliver it twice. Use create_draft to compose a new message instead.`);
3720
3720
  }
3721
+ // Mirrors the check above but for the same-ordering case: a draft
3722
+ // has no "scheduled" status (only "draft"/"sent" — see
3723
+ // DraftStoreService), so calling schedule_draft twice on the same
3724
+ // still-"draft" draft (e.g. to change sendAt, or a client retry
3725
+ // after an ambiguous response) sailed past the status check above
3726
+ // and enqueued a second, independent delivery-queue record. Both
3727
+ // fire independently later, delivering the same email twice.
3728
+ const alreadyPendingScheduled = (await deliveryQueueService.list()).find((record) => record.sourceDraftId === draft.id && record.status === "pending");
3729
+ if (alreadyPendingScheduled) {
3730
+ throw new McpError(ErrorCode.InvalidParams, `This draft already has a pending scheduled send (id ${alreadyPendingScheduled.id}, sendAt ${alreadyPendingScheduled.sendAt}). Scheduling it again would deliver it twice. Cancel the existing one with cancel_send first if you want a different sendAt.`);
3731
+ }
3721
3732
  const sendAt = requireString(args, "sendAt");
3722
3733
  const sendAtTime = new Date(sendAt).getTime();
3723
3734
  if (Number.isNaN(sendAtTime)) {
@@ -4427,7 +4438,15 @@ export function createServer(config, options = {}) {
4427
4438
  const idleProbe = includeIdleProbe
4428
4439
  ? await Promise.allSettled([
4429
4440
  imapService.waitForMailboxChanges({
4430
- folder: config.runtime.autoSyncFolder,
4441
+ // autoSyncFolder is a comma-separated list ("INBOX,Sent") for
4442
+ // the periodic index sync, but IMAP IDLE can only watch one
4443
+ // mailbox per connection (same constraint documented on
4444
+ // BackgroundSyncService's primaryIdleFolder). Passing the raw
4445
+ // multi-folder string through made every run_doctor
4446
+ // includeIdleProbe:true call try to SELECT a literal mailbox
4447
+ // named "INBOX,Sent" and fail — reproduced live, 100% of the
4448
+ // time with the default config.
4449
+ folder: config.runtime.autoSyncFolder?.split(",")[0]?.trim() || "INBOX",
4431
4450
  timeoutMs: idleTimeoutSeconds * 1000,
4432
4451
  }),
4433
4452
  ]).then(([result]) => result)
@@ -4494,6 +4513,11 @@ export function createServer(config, options = {}) {
4494
4513
  ? idleProbe.reason.message
4495
4514
  : String(idleProbe.reason)
4496
4515
  : "IMAP connection failed.",
4516
+ // smtp/imap above both attach this; idleProbe never did,
4517
+ // so an idle-specific failure (e.g. the wrong-folder bug
4518
+ // just fixed above) gave no actionable next step despite
4519
+ // this tool's own description promising one.
4520
+ diagnosis: diagnoseFailure(idleProbe.reason),
4497
4521
  },
4498
4522
  backgroundSync: backgroundSyncService.getStatus(),
4499
4523
  index: indexStatus,