@remit/mailbox-service 0.0.68 → 0.0.70

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.68",
3
+ "version": "0.0.70",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -201,6 +201,15 @@ describe("what a mailbox says about the addresses on its messages", () => {
201
201
  assert.deepEqual(emails(saved.envelopeAddresses), BOTH);
202
202
  });
203
203
 
204
+ it("leaves the identity of an envelope address to the store", async () => {
205
+ const saved = await save(mailboxAt("INBOX"));
206
+
207
+ assert.ok(saved.envelopeAddresses.length > 0);
208
+ for (const envelopeAddress of saved.envelopeAddresses) {
209
+ assert.ok(!("envelopeAddressId" in envelopeAddress));
210
+ }
211
+ });
212
+
204
213
  it("keeps a message in Trash from deciding either way", async () => {
205
214
  const saved = await save(mailboxAt("Trash"), "Trash");
206
215
 
@@ -16,7 +16,6 @@ import { storedDisplayName } from "@remit/data-ports/display-name";
16
16
  import {
17
17
  deriveAddressId,
18
18
  deriveBodyPartId,
19
- deriveEnvelopeAddressId,
20
19
  deriveEnvelopeId,
21
20
  deriveMessageIdFromSource,
22
21
  deriveThreadId,
@@ -1506,8 +1505,6 @@ export class MessageSyncService {
1506
1505
 
1507
1506
  const addressId = deriveAddressId(accountConfigId, normalizedEmail);
1508
1507
 
1509
- const envelopeAddressId = deriveEnvelopeAddressId(messageId, role, order);
1510
-
1511
1508
  const addressInput = {
1512
1509
  addressId,
1513
1510
  accountConfigId,
@@ -1526,7 +1523,6 @@ export class MessageSyncService {
1526
1523
  }
1527
1524
 
1528
1525
  await addressService.upsertEnvelopeAddress({
1529
- envelopeAddressId,
1530
1526
  messageId,
1531
1527
  addressId,
1532
1528
  displayName,
@@ -231,7 +231,21 @@ export class OutboxQueueService {
231
231
  OutboxMessageStatus.queued,
232
232
  );
233
233
 
234
- await this.enqueueSend(existing.accountId, outboxMessageId);
234
+ // `queued` is a dead end for a row the queue never accepted: `send` takes
235
+ // draft, failed and blocked, `deleteDraft` those three plus unfiled, so a
236
+ // row parked at `queued` by a failed enqueue is neither sendable nor
237
+ // discardable (#845.8). Put it back where it came from and let the enqueue
238
+ // failure surface — the row stays reachable, the caller still hears no.
239
+ await this.enqueueSend(existing.accountId, outboxMessageId).catch(
240
+ async (error: unknown) => {
241
+ await this.outboxMessageService.updateStatus(
242
+ accountConfigId,
243
+ outboxMessageId,
244
+ existing.status,
245
+ );
246
+ throw error;
247
+ },
248
+ );
235
249
 
236
250
  this.log.info(
237
251
  { outboxMessageId, accountId: existing.accountId },