@crvouga/mockingbird-service-odx 1.0.2 → 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,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-odx
2
2
 
3
- ## 1.0.2 (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)
4
16
 
5
17
  ### Fixes and improvements
6
18
 
@@ -1259,7 +1259,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1259
1259
  };
1260
1260
 
1261
1261
  // ../core/dist/version.js
1262
- var PACKAGE_VERSION = true ? "1.0.2" : UNRELEASED_VERSION;
1262
+ var PACKAGE_VERSION = true ? "1.1.0" : UNRELEASED_VERSION;
1263
1263
 
1264
1264
  // ../core/dist/signing.js
1265
1265
  var encoder = new TextEncoder();
@@ -1352,6 +1352,7 @@ var createWebhookHub = (options) => {
1352
1352
  const faults = /* @__PURE__ */ new Map();
1353
1353
  const held = /* @__PURE__ */ new Map();
1354
1354
  const inFlight = /* @__PURE__ */ new Set();
1355
+ let immediate = Promise.resolve();
1355
1356
  const track = (work) => {
1356
1357
  inFlight.add(work);
1357
1358
  void work.finally(() => inFlight.delete(work));
@@ -1414,22 +1415,28 @@ var createWebhookHub = (options) => {
1414
1415
  pending.delete(delivery.id);
1415
1416
  return;
1416
1417
  }
1417
- const run = () => {
1418
- pending.delete(delivery.id);
1419
- track(attempt(delivery).then((ok) => {
1418
+ const settle = async () => {
1419
+ if (!payloads.has(delivery.id))
1420
+ return;
1421
+ await attempt(delivery).then((ok) => {
1420
1422
  if (ok)
1421
1423
  delivery.state = "delivered";
1422
1424
  else
1423
1425
  schedule(delivery);
1424
- }));
1426
+ });
1425
1427
  };
1426
1428
  const delay = delays[index] ?? 0;
1427
1429
  if (delay <= 0) {
1428
- pending.set(delivery.id, void 0);
1429
- run();
1430
+ const task = immediate.then(settle);
1431
+ immediate = task.catch(() => {
1432
+ });
1433
+ track(task);
1430
1434
  return;
1431
1435
  }
1432
- const timer = scheduleTimer(run, delay);
1436
+ const timer = scheduleTimer(() => {
1437
+ pending.delete(delivery.id);
1438
+ track(settle());
1439
+ }, delay);
1433
1440
  unref(timer);
1434
1441
  pending.set(delivery.id, timer);
1435
1442
  };
@@ -1525,25 +1532,30 @@ var createWebhookHub = (options) => {
1525
1532
  return delivery;
1526
1533
  },
1527
1534
  async flush() {
1528
- for (const namespace of [...held.keys()])
1529
- releaseHeld(namespace);
1530
- const waiting = [...pending.entries()];
1531
- for (const [id2, timer] of waiting) {
1532
- if (timer === void 0)
1533
- continue;
1534
- cancel(timer);
1535
- pending.delete(id2);
1536
- const delivery = deliveries.get(id2);
1537
- if (!delivery)
1538
- continue;
1539
- track(attempt(delivery).then((ok) => {
1540
- if (ok)
1541
- delivery.state = "delivered";
1542
- else
1543
- schedule(delivery);
1544
- }));
1535
+ for (; ; ) {
1536
+ for (const namespace of [...held.keys()])
1537
+ releaseHeld(namespace);
1538
+ const waiting = [...pending.entries()];
1539
+ for (const [id2, timer] of waiting) {
1540
+ if (timer === void 0)
1541
+ continue;
1542
+ cancel(timer);
1543
+ pending.delete(id2);
1544
+ const delivery = deliveries.get(id2);
1545
+ if (!delivery)
1546
+ continue;
1547
+ track(attempt(delivery).then((ok) => {
1548
+ if (ok)
1549
+ delivery.state = "delivered";
1550
+ else
1551
+ schedule(delivery);
1552
+ }));
1553
+ }
1554
+ await hub.idle();
1555
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
1556
+ if (held.size === 0 && !scheduled)
1557
+ return;
1545
1558
  }
1546
- await hub.idle();
1547
1559
  },
1548
1560
  async idle() {
1549
1561
  while (inFlight.size > 0)
@@ -3256,4 +3268,4 @@ export {
3256
3268
  apiKeyCredential,
3257
3269
  OdxAPI
3258
3270
  };
3259
- //# sourceMappingURL=chunk-XITCXMFI.js.map
3271
+ //# sourceMappingURL=chunk-LY2E2EGZ.js.map