@remit/mailbox-service 0.0.54 → 0.0.56

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/mailbox-service",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,16 +1,3 @@
1
- /**
2
- * Harvesting takes the display name straight off the envelope, and a sender
3
- * chooses that string. A 2021 spam message reached this account's INBOX with
4
- * `matthijs@ischen.nl <aramirez@secresaludguaviare.gov.co>`: the account's own
5
- * address as the label on a stranger's. It was stored, autocomplete offered it
6
- * back when the account holder typed his own address, and a private reply left
7
- * the instance (issue #826).
8
- *
9
- * The name lands in three columns on this one save — the address book, the
10
- * envelope the message header renders, and the sender label the message list
11
- * shows and search indexes — so all three are asserted here.
12
- */
13
-
14
1
  import assert from "node:assert/strict";
15
2
  import { describe, it } from "node:test";
16
3
  import type {
@@ -50,10 +37,6 @@ interface Saved {
50
37
  threadMessages: CreateThreadMessageInput[];
51
38
  }
52
39
 
53
- /**
54
- * Drive the real save path so the stored value is the one the write path
55
- * produces, not one a test handed to a private method.
56
- */
57
40
  const harvest = async (envelope: Partial<ImapEnvelope>): Promise<Saved> => {
58
41
  const saved: Saved = {
59
42
  addresses: [],
@@ -149,12 +132,6 @@ describe("harvesting an envelope display name", () => {
149
132
  );
150
133
  });
151
134
 
152
- /**
153
- * The incident with one word prepended. An anchored guard reads this as an
154
- * ordinary name and stores it, and autocomplete then ties it with the real
155
- * address on the term `matthijs` and breaks the tie on correspondence. The
156
- * word itself is not the lie, so it survives the address being removed.
157
- */
158
135
  it("keeps what a name says besides the address it claims", async () => {
159
136
  const input = await onlyAddress({
160
137
  from: [{ ...spoof, name: "Matthijs <matthijs@ischen.nl>" }],
@@ -256,10 +256,14 @@ export class OutboxQueueService {
256
256
  outboxMessageId,
257
257
  "act",
258
258
  );
259
+ // `unfiled` is discardable: the message was delivered but never landed in
260
+ // a Sent folder, so this row is the only copy the user has and dismissing
261
+ // it is their acknowledgement.
259
262
  if (
260
263
  existing.status !== OutboxMessageStatus.draft &&
261
264
  existing.status !== OutboxMessageStatus.failed &&
262
- existing.status !== OutboxMessageStatus.blocked
265
+ existing.status !== OutboxMessageStatus.blocked &&
266
+ existing.status !== OutboxMessageStatus.unfiled
263
267
  ) {
264
268
  throw new ConflictError(
265
269
  `This message is already ${existing.status} and can no longer be discarded. Open the Outbox to see where it stands.`,