@crvouga/mockingbird-service-resend 1.0.1 → 1.1.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # Changelog — @crvouga/mockingbird-service-resend
2
2
 
3
- ## 1.0.1 (2026-09-26)
3
+ ## 1.1.0 (2026-09-29)
4
+
5
+ ### Features
6
+
7
+ - let a scalar naming a later branch's enum value pick that branch ([30ade3a](https://github.com/crvouga/mockingbird/commit/30ade3a28a5b6b273ffbf261216b821acac8e961))
8
+
9
+ ### Fixes and improvements
10
+
11
+ - stop cleared webhook deliveries from rescheduling forever ([424b78f](https://github.com/crvouga/mockingbird/commit/424b78f29317b162e3bf7d0049cc19be5b977026))
12
+ - serialize immediate webhook attempts to fix reorder flake ([625c82b](https://github.com/crvouga/mockingbird/commit/625c82b5a8a7992c1cf93e9df68e77af08b353e3))
13
+ - flush drains webhook retries scheduled while it runs ([c58cede](https://github.com/crvouga/mockingbird/commit/c58cede1b6ba7ae5ed3f8721ad9b7cd7bc0b1ca7))
14
+
15
+ ## 1.0.2 (2026-09-25)
16
+
17
+ ### Fixes and improvements
18
+
19
+ - treat enum [""] branches as unset markers in form coercion ([7177835](https://github.com/crvouga/mockingbird/commit/7177835cc510e14245d6648ad2821daa694bb80c))
20
+
21
+ ## 1.0.1 (2026-09-25)
4
22
 
5
23
  ### Fixes and improvements
6
24
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-C4R6D4IN.js";
3
+ } from "./chunk-AQUFPFU6.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -368,4 +368,4 @@ export {
368
368
  createServer2 as createServer,
369
369
  serveTarget
370
370
  };
371
- //# sourceMappingURL=chunk-DRZ6C7OK.js.map
371
+ //# sourceMappingURL=chunk-2SDR3UDQ.js.map
@@ -1709,7 +1709,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1709
1709
  };
1710
1710
 
1711
1711
  // ../core/dist/version.js
1712
- var PACKAGE_VERSION = true ? "1.0.1" : UNRELEASED_VERSION;
1712
+ var PACKAGE_VERSION = true ? "1.1.0" : UNRELEASED_VERSION;
1713
1713
 
1714
1714
  // ../core/dist/signing.js
1715
1715
  var encoder = new TextEncoder();
@@ -1802,6 +1802,7 @@ var createWebhookHub = (options) => {
1802
1802
  const faults = /* @__PURE__ */ new Map();
1803
1803
  const held = /* @__PURE__ */ new Map();
1804
1804
  const inFlight2 = /* @__PURE__ */ new Set();
1805
+ let immediate = Promise.resolve();
1805
1806
  const track = (work) => {
1806
1807
  inFlight2.add(work);
1807
1808
  void work.finally(() => inFlight2.delete(work));
@@ -1864,22 +1865,28 @@ var createWebhookHub = (options) => {
1864
1865
  pending.delete(delivery.id);
1865
1866
  return;
1866
1867
  }
1867
- const run = () => {
1868
- pending.delete(delivery.id);
1869
- track(attempt(delivery).then((ok) => {
1868
+ const settle = async () => {
1869
+ if (!payloads.has(delivery.id))
1870
+ return;
1871
+ await attempt(delivery).then((ok) => {
1870
1872
  if (ok)
1871
1873
  delivery.state = "delivered";
1872
1874
  else
1873
1875
  schedule(delivery);
1874
- }));
1876
+ });
1875
1877
  };
1876
1878
  const delay = delays[index] ?? 0;
1877
1879
  if (delay <= 0) {
1878
- pending.set(delivery.id, void 0);
1879
- run();
1880
+ const task = immediate.then(settle);
1881
+ immediate = task.catch(() => {
1882
+ });
1883
+ track(task);
1880
1884
  return;
1881
1885
  }
1882
- const timer = scheduleTimer(run, delay);
1886
+ const timer = scheduleTimer(() => {
1887
+ pending.delete(delivery.id);
1888
+ track(settle());
1889
+ }, delay);
1883
1890
  unref(timer);
1884
1891
  pending.set(delivery.id, timer);
1885
1892
  };
@@ -1975,25 +1982,30 @@ var createWebhookHub = (options) => {
1975
1982
  return delivery;
1976
1983
  },
1977
1984
  async flush() {
1978
- for (const namespace of [...held.keys()])
1979
- releaseHeld(namespace);
1980
- const waiting = [...pending.entries()];
1981
- for (const [id2, timer] of waiting) {
1982
- if (timer === void 0)
1983
- continue;
1984
- cancel(timer);
1985
- pending.delete(id2);
1986
- const delivery = deliveries.get(id2);
1987
- if (!delivery)
1988
- continue;
1989
- track(attempt(delivery).then((ok) => {
1990
- if (ok)
1991
- delivery.state = "delivered";
1992
- else
1993
- schedule(delivery);
1994
- }));
1985
+ for (; ; ) {
1986
+ for (const namespace of [...held.keys()])
1987
+ releaseHeld(namespace);
1988
+ const waiting = [...pending.entries()];
1989
+ for (const [id2, timer] of waiting) {
1990
+ if (timer === void 0)
1991
+ continue;
1992
+ cancel(timer);
1993
+ pending.delete(id2);
1994
+ const delivery = deliveries.get(id2);
1995
+ if (!delivery)
1996
+ continue;
1997
+ track(attempt(delivery).then((ok) => {
1998
+ if (ok)
1999
+ delivery.state = "delivered";
2000
+ else
2001
+ schedule(delivery);
2002
+ }));
2003
+ }
2004
+ await hub.idle();
2005
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
2006
+ if (held.size === 0 && !scheduled)
2007
+ return;
1995
2008
  }
1996
- await hub.idle();
1997
2009
  },
1998
2010
  async idle() {
1999
2011
  while (inFlight2.size > 0)
@@ -3302,4 +3314,4 @@ export {
3302
3314
  bareAddress,
3303
3315
  ResendAPI
3304
3316
  };
3305
- //# sourceMappingURL=chunk-C4R6D4IN.js.map
3317
+ //# sourceMappingURL=chunk-AQUFPFU6.js.map