@remit/data-ports 0.0.68 → 0.0.69

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/package.json +1 -1
  2. package/src/errors.ts +11 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/data-ports",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/errors.ts CHANGED
@@ -81,13 +81,19 @@ export class FolderRoleUnresolvedError extends ConflictError {
81
81
  }
82
82
 
83
83
  /**
84
- * A role cannot be appointed to a mailbox the mail server has not settled yet
85
- * (imap-mutations R2: wait). Its own code, because the role is not unresolved —
86
- * the target is: the client words a wait, not a retry. Clearing a role is never
87
- * refused this way.
84
+ * A durable reference cannot be bound to a mailbox whose own mutation has not
85
+ * settled (folder-rename-and-delete.md D12, imap-mutations R2: wait). Its own
86
+ * code, because the role is not unresolved — the target is: the client words a
87
+ * wait, not a retry. Clearing a role is never refused this way.
88
+ *
89
+ * **422, not 409** (D4). 409 already means "this folder is being changed right
90
+ * now, refresh"; this means "the folder you are pointing at has not settled
91
+ * yet", which is a different sentence and a different remedy. The status is
92
+ * what separates them for a client that reads no further.
88
93
  */
89
- export class MailboxNotSettledError extends ConflictError {
94
+ export class MailboxNotSettledError extends HTTPError {
90
95
  name = "MailboxNotSettledError";
96
+ public statusCode = 422;
91
97
 
92
98
  constructor(message: string, mailboxId: string, syncStatus: string) {
93
99
  super(message);