@crvouga/mockingbird-service-fullscript 1.0.2 → 1.1.1

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-fullscript
2
2
 
3
- ## 1.0.2 (2026-09-26)
3
+ ## 1.1.1 (2026-09-29)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - sign and retry webhooks on the injected clock ([1091bde](https://github.com/crvouga/mockingbird/commit/1091bde0df69d9cc3eba2062d8523755e6caca14))
8
+
9
+ ## 1.1.0 (2026-09-29)
10
+
11
+ ### Features
12
+
13
+ - let a scalar naming a later branch's enum value pick that branch ([30ade3a](https://github.com/crvouga/mockingbird/commit/30ade3a28a5b6b273ffbf261216b821acac8e961))
14
+
15
+ ### Fixes and improvements
16
+
17
+ - stop cleared webhook deliveries from rescheduling forever ([424b78f](https://github.com/crvouga/mockingbird/commit/424b78f29317b162e3bf7d0049cc19be5b977026))
18
+ - serialize immediate webhook attempts to fix reorder flake ([625c82b](https://github.com/crvouga/mockingbird/commit/625c82b5a8a7992c1cf93e9df68e77af08b353e3))
19
+ - flush drains webhook retries scheduled while it runs ([c58cede](https://github.com/crvouga/mockingbird/commit/c58cede1b6ba7ae5ed3f8721ad9b7cd7bc0b1ca7))
20
+
21
+ ## 1.0.2 (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-SYF4U77V.js";
3
+ } from "./chunk-7353U527.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -379,4 +379,4 @@ export {
379
379
  createServer2 as createServer,
380
380
  serveTarget
381
381
  };
382
- //# sourceMappingURL=chunk-UMIAX3DP.js.map
382
+ //# sourceMappingURL=chunk-4M25CDSF.js.map
@@ -1594,7 +1594,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1594
1594
  };
1595
1595
 
1596
1596
  // ../core/dist/version.js
1597
- var PACKAGE_VERSION = true ? "1.0.2" : UNRELEASED_VERSION;
1597
+ var PACKAGE_VERSION = true ? "1.1.1" : UNRELEASED_VERSION;
1598
1598
 
1599
1599
  // ../core/dist/signing.js
1600
1600
  var encoder = new TextEncoder();
@@ -1687,6 +1687,7 @@ var createWebhookHub = (options) => {
1687
1687
  const faults = /* @__PURE__ */ new Map();
1688
1688
  const held = /* @__PURE__ */ new Map();
1689
1689
  const inFlight = /* @__PURE__ */ new Set();
1690
+ let immediate = Promise.resolve();
1690
1691
  const track = (work) => {
1691
1692
  inFlight.add(work);
1692
1693
  void work.finally(() => inFlight.delete(work));
@@ -1749,22 +1750,28 @@ var createWebhookHub = (options) => {
1749
1750
  pending.delete(delivery.id);
1750
1751
  return;
1751
1752
  }
1752
- const run = () => {
1753
- pending.delete(delivery.id);
1754
- track(attempt(delivery).then((ok2) => {
1753
+ const settle = async () => {
1754
+ if (!payloads.has(delivery.id))
1755
+ return;
1756
+ await attempt(delivery).then((ok2) => {
1755
1757
  if (ok2)
1756
1758
  delivery.state = "delivered";
1757
1759
  else
1758
1760
  schedule(delivery);
1759
- }));
1761
+ });
1760
1762
  };
1761
1763
  const delay = delays[index] ?? 0;
1762
1764
  if (delay <= 0) {
1763
- pending.set(delivery.id, void 0);
1764
- run();
1765
+ const task = immediate.then(settle);
1766
+ immediate = task.catch(() => {
1767
+ });
1768
+ track(task);
1765
1769
  return;
1766
1770
  }
1767
- const timer = scheduleTimer(run, delay);
1771
+ const timer = scheduleTimer(() => {
1772
+ pending.delete(delivery.id);
1773
+ track(settle());
1774
+ }, delay);
1768
1775
  unref(timer);
1769
1776
  pending.set(delivery.id, timer);
1770
1777
  };
@@ -1860,25 +1867,30 @@ var createWebhookHub = (options) => {
1860
1867
  return delivery;
1861
1868
  },
1862
1869
  async flush() {
1863
- for (const namespace of [...held.keys()])
1864
- releaseHeld(namespace);
1865
- const waiting = [...pending.entries()];
1866
- for (const [id2, timer] of waiting) {
1867
- if (timer === void 0)
1868
- continue;
1869
- cancel(timer);
1870
- pending.delete(id2);
1871
- const delivery = deliveries.get(id2);
1872
- if (!delivery)
1873
- continue;
1874
- track(attempt(delivery).then((ok2) => {
1875
- if (ok2)
1876
- delivery.state = "delivered";
1877
- else
1878
- schedule(delivery);
1879
- }));
1870
+ for (; ; ) {
1871
+ for (const namespace of [...held.keys()])
1872
+ releaseHeld(namespace);
1873
+ const waiting = [...pending.entries()];
1874
+ for (const [id2, timer] of waiting) {
1875
+ if (timer === void 0)
1876
+ continue;
1877
+ cancel(timer);
1878
+ pending.delete(id2);
1879
+ const delivery = deliveries.get(id2);
1880
+ if (!delivery)
1881
+ continue;
1882
+ track(attempt(delivery).then((ok2) => {
1883
+ if (ok2)
1884
+ delivery.state = "delivered";
1885
+ else
1886
+ schedule(delivery);
1887
+ }));
1888
+ }
1889
+ await hub.idle();
1890
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
1891
+ if (held.size === 0 && !scheduled)
1892
+ return;
1880
1893
  }
1881
- await hub.idle();
1882
1894
  },
1883
1895
  async idle() {
1884
1896
  while (inFlight.size > 0)
@@ -3481,4 +3493,4 @@ export {
3481
3493
  envelope,
3482
3494
  FullscriptAPI
3483
3495
  };
3484
- //# sourceMappingURL=chunk-SYF4U77V.js.map
3496
+ //# sourceMappingURL=chunk-7353U527.js.map