@remit/imap-worker 0.0.31 → 0.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/imap-worker",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -106,6 +106,10 @@ const deps = (): MailboxManagementDeps =>
106
106
  h.calls.push({ method: "mailbox.update", args });
107
107
  if (h.mailboxUpdateError) throw h.mailboxUpdateError;
108
108
  },
109
+ findByPathPrefix: async (...args: unknown[]) => {
110
+ h.calls.push({ method: "mailbox.findByPathPrefix", args });
111
+ return [];
112
+ },
109
113
  delete: record("mailbox.delete"),
110
114
  },
111
115
  secrets: {},
@@ -70,15 +70,18 @@ const isMailboxPresentUpstream = (error: unknown): boolean => {
70
70
  * Pinned invariant for the whole-chain terminal guards below.
71
71
  *
72
72
  * Each handler wraps its `MailboxManagementService.sync*` chain in a try/catch
73
- * that treats a NotFoundError as terminal (ack with a WARN, issue #289). That
74
- * is only sound because `syncCreate` / `syncRename` / `syncDelete` and their
75
- * error-recovery branches here touch nothing but the single target mailbox
76
- * row via `mailboxService.get/update/delete(accountId, mailboxId)`. So the only
77
- * row a NotFoundError can refer to is that target, and its absence can only mean
78
- * the user deleted the folder mid-sync never an unrelated missing entity that
79
- * should have been retried. If a sync method ever reads or writes a second
80
- * entity, narrow these catches (match the mailboxId / re-check existence) before
81
- * a NotFoundError from elsewhere is silently acked.
73
+ * that treats a NotFoundError as terminal (ack with a WARN, issue #289). That is
74
+ * only sound while the sole row a NotFoundError can refer to is the target
75
+ * mailbox, so its absence can only mean the user deleted the folder mid-sync —
76
+ * never an unrelated missing entity that should have been retried.
77
+ *
78
+ * `syncCreate` and `syncDelete` hold to that by touching nothing but the target
79
+ * row. `syncRename` also writes the renamed subtree's descendant rows, and keeps
80
+ * the invariant by absorbing their NotFoundErrors itself: a descendant deleted
81
+ * mid-settle never reaches these catches. Any sync method that reads or writes a
82
+ * second entity owes the same, or these catches must be narrowed (match the
83
+ * mailboxId / re-check existence) before a NotFoundError from elsewhere is
84
+ * silently acked.
82
85
  */
83
86
 
84
87
  /**