@remit/ui 0.0.18 → 0.0.19

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/ui",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -15,7 +15,7 @@ export const quarantineDemoEntries: readonly QuarantineEntry[] = [
15
15
  mailboxRole: "inbox",
16
16
  mailboxPath: "INBOX",
17
17
  failureStage: "BodyParse",
18
- failureCode: "UnterminatedMultipartBoundary",
18
+ failureCode: "UnreadableBody",
19
19
  failureMessage: "multipart boundary was never closed",
20
20
  failurePartPath: undefined,
21
21
  quarantinedAt: Date.parse("2026-07-18T09:12:00Z"),
@@ -67,7 +67,7 @@ export const quarantineDemoEntries: readonly QuarantineEntry[] = [
67
67
  mailboxRole: undefined,
68
68
  mailboxPath: "Clients/Acme Holdings",
69
69
  failureStage: "BodyParse",
70
- failureCode: "TruncatedBody",
70
+ failureCode: "UnreadableBody",
71
71
  failureMessage: "stream ended before the declared body length",
72
72
  failurePartPath: undefined,
73
73
  quarantinedAt: Date.parse("2026-07-19T06:03:00Z"),
@@ -92,7 +92,7 @@ export const quarantineDemoEntries: readonly QuarantineEntry[] = [
92
92
  mailboxRole: "inbox",
93
93
  mailboxPath: "INBOX",
94
94
  failureStage: "BodyParse",
95
- failureCode: "TruncatedBody",
95
+ failureCode: "UnreadableBody",
96
96
  failureMessage: "connection closed mid-body",
97
97
  failurePartPath: undefined,
98
98
  quarantinedAt: Date.parse("2026-07-19T11:27:00Z"),
@@ -20,7 +20,7 @@ describe("formatQuarantineReport", () => {
20
20
  it("names the stage, the code and the build that failed", () => {
21
21
  const report = formatQuarantineReport(entry);
22
22
  assert.match(report, /BodyParse/);
23
- assert.match(report, /UnterminatedMultipartBoundary/);
23
+ assert.match(report, /UnreadableBody/);
24
24
  assert.match(report, /worker 1\.0\.0/);
25
25
  });
26
26
 
@@ -186,7 +186,7 @@ describe("quarantineReportSections", () => {
186
186
  describe("quarantineIssueTitle", () => {
187
187
  it("carries only the closed vocabulary", () => {
188
188
  const title = quarantineIssueTitle(entry);
189
- assert.match(title, /UnterminatedMultipartBoundary/);
189
+ assert.match(title, /UnreadableBody/);
190
190
  assert.match(title, /BodyParse/);
191
191
  assert.doesNotMatch(title, /joan@/);
192
192
  });
@@ -3,31 +3,17 @@ import type { FolderRole } from "./folder-role.js";
3
3
  /**
4
4
  * The pipeline step that refused the message.
5
5
  *
6
- * One member, because **no catch site on the sync path can currently tell a
7
- * parse failure from an infrastructure failure**. The per-message frame in
8
- * `body-sync.ts` wraps the S3 body write, the parsed-body cache write, the
9
- * body-part `pMap` and DynamoDB upsert, the placement move (SQS + DynamoDB)
10
- * and the label and counter writes, alongside the `simpleParser` call; only
11
- * connection drops are filtered out of it.
6
+ * One member, behind a real narrowing rather than a promise of one: the body
7
+ * parse has its own try block around the parse call and nothing else, so an
8
+ * error out of it can only be the message. S3, queue and database failures
9
+ * propagate and never become a record here quarantining one would set a
10
+ * message aside for an outage, tell the user it was unreadable, and invite a
11
+ * public GitHub issue about it.
12
12
  *
13
- * **Precondition on Phase 3**: narrow the try block to the parse call before
14
- * quarantining anything. Quarantining at the frame as it stands would set a
15
- * message aside for a DynamoDB throttle, tell the user it was unreadable, and
16
- * invite a public GitHub issue for an outage — the same defect as naming an
17
- * S3 write `AttachmentExtract`, one layer up.
18
- *
19
- * There are three distinct parse sites, and a quarantine would have to
20
- * attribute them differently: the fresh-fetch path, `backfillClassification`
21
- * (its own parse over a different result list), and the header parse in
22
- * `imapflow-connection.ts`, which is swallowed and treated as "no thread
23
- * parent". Stages are added as those sites are separated — never ahead of it.
24
- *
25
- * The stages this replaced could not fire at all: an unparseable Date falls
26
- * back to INTERNALDATE, and an unrecognized MIME type maps to a safe default
27
- * rather than throwing. Unparseable addresses are dropped with a `continue`
28
- * and the message is written anyway — so that defect is reached but discarded,
29
- * never raised, which is a reason to have no `AddressParse` stage but not the
30
- * reason that it cannot happen.
13
+ * A message that arrives with no ENVELOPE is deliberately not a member:
14
+ * nothing can tell that apart from the FETCH row glitching, and the IMAP
15
+ * client is far more often the cause than the message. The sync path holds its
16
+ * cursor and retries instead.
31
17
  */
32
18
  export type QuarantineFailureStage = "BodyParse";
33
19
 
@@ -36,13 +22,15 @@ export type QuarantineFailureStage = "BodyParse";
36
22
  *
37
23
  * Closed, because `quarantineIssueTitle` interpolates it into a public issue
38
24
  * title: a `string` here would make the one field whose publishability is
39
- * asserted rather than derived into free text. Grows with the narrowing
40
- * described on `QuarantineFailureStage`, and no faster.
25
+ * asserted rather than derived into free text.
26
+ *
27
+ * Total and small. The body parser reports its refusals as free text with no
28
+ * stable type or code, so a member exists only where the writer can identify
29
+ * the defect without reading parser prose; anything it cannot name is
30
+ * `UnreadableBody`, and the parser's own words stay in `failureMessage`, which
31
+ * is shown on screen and never published.
41
32
  */
42
- export type QuarantineFailureCode =
43
- | "UnterminatedMultipartBoundary"
44
- | "UnknownCharset"
45
- | "TruncatedBody";
33
+ export type QuarantineFailureCode = "UnknownCharset" | "UnreadableBody";
46
34
 
47
35
  /**
48
36
  * One node of the message's MIME tree, in a pre-order walk.
@@ -61,7 +61,7 @@ describe("QuarantineBugDialog", () => {
61
61
  issueUrl: ISSUE_URL,
62
62
  }),
63
63
  );
64
- assert.match(html, /UnterminatedMultipartBoundary/);
64
+ assert.match(html, /UnreadableBody/);
65
65
  assert.match(html, /attachment names, or the parser's own error text/);
66
66
  assert.match(html, /Copy report/);
67
67
  });