@remit/smtp-worker 0.0.21 → 0.0.22
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
|
@@ -329,6 +329,24 @@ describe("sendMessage handler", () => {
|
|
|
329
329
|
assert.equal(recorded.updates.length, 0);
|
|
330
330
|
});
|
|
331
331
|
|
|
332
|
+
it("drops the event for a row the enqueue settled at `failed`", async () => {
|
|
333
|
+
// The other half of #936. An error from SQS `SendMessage` says the response
|
|
334
|
+
// was lost, not that the broker refused the event, so the row is settled
|
|
335
|
+
// outside this fence and the event that landed anyway dies here. Settling
|
|
336
|
+
// it at `draft` instead would send it — and leave the user a row they can
|
|
337
|
+
// send a second time.
|
|
338
|
+
const { deps, recorded } = buildDeps({
|
|
339
|
+
outbox: buildOutbox({ status: "failed" }),
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
await sendMessage(event, silentLogger, deps);
|
|
343
|
+
|
|
344
|
+
assert.equal(recorded.sendCalls, 0, "must not send");
|
|
345
|
+
assert.equal(recorded.marked.length, 0);
|
|
346
|
+
assert.equal(recorded.updates.length, 0);
|
|
347
|
+
assert.equal(recorded.statuses.length, 0);
|
|
348
|
+
});
|
|
349
|
+
|
|
332
350
|
it("settles the row as unfiled when the append event cannot be queued", async () => {
|
|
333
351
|
const { deps, recorded } = buildDeps({
|
|
334
352
|
account: buildAccount({ smtpHost: "smtp.example.com", smtpPort: 587 }),
|