@crvouga/mockingbird-service-livekit 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-livekit
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
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-7ZW474B4.js";
3
+ } from "./chunk-VTZE67GX.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -329,4 +329,4 @@ export {
329
329
  createServer2 as createServer,
330
330
  serveTarget
331
331
  };
332
- //# sourceMappingURL=chunk-FLL2NHOD.js.map
332
+ //# sourceMappingURL=chunk-HQHW6RYK.js.map
@@ -1429,7 +1429,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1429
1429
  };
1430
1430
 
1431
1431
  // ../core/dist/version.js
1432
- var PACKAGE_VERSION = true ? "1.0.2" : UNRELEASED_VERSION;
1432
+ var PACKAGE_VERSION = true ? "1.1.0" : UNRELEASED_VERSION;
1433
1433
 
1434
1434
  // ../core/dist/signing.js
1435
1435
  var encoder = new TextEncoder();
@@ -1522,6 +1522,7 @@ var createWebhookHub = (options) => {
1522
1522
  const faults = /* @__PURE__ */ new Map();
1523
1523
  const held = /* @__PURE__ */ new Map();
1524
1524
  const inFlight = /* @__PURE__ */ new Set();
1525
+ let immediate = Promise.resolve();
1525
1526
  const track = (work) => {
1526
1527
  inFlight.add(work);
1527
1528
  void work.finally(() => inFlight.delete(work));
@@ -1584,22 +1585,28 @@ var createWebhookHub = (options) => {
1584
1585
  pending.delete(delivery.id);
1585
1586
  return;
1586
1587
  }
1587
- const run = () => {
1588
- pending.delete(delivery.id);
1589
- track(attempt(delivery).then((ok) => {
1588
+ const settle = async () => {
1589
+ if (!payloads.has(delivery.id))
1590
+ return;
1591
+ await attempt(delivery).then((ok) => {
1590
1592
  if (ok)
1591
1593
  delivery.state = "delivered";
1592
1594
  else
1593
1595
  schedule(delivery);
1594
- }));
1596
+ });
1595
1597
  };
1596
1598
  const delay = delays[index] ?? 0;
1597
1599
  if (delay <= 0) {
1598
- pending.set(delivery.id, void 0);
1599
- run();
1600
+ const task = immediate.then(settle);
1601
+ immediate = task.catch(() => {
1602
+ });
1603
+ track(task);
1600
1604
  return;
1601
1605
  }
1602
- const timer = scheduleTimer(run, delay);
1606
+ const timer = scheduleTimer(() => {
1607
+ pending.delete(delivery.id);
1608
+ track(settle());
1609
+ }, delay);
1603
1610
  unref(timer);
1604
1611
  pending.set(delivery.id, timer);
1605
1612
  };
@@ -1695,25 +1702,30 @@ var createWebhookHub = (options) => {
1695
1702
  return delivery;
1696
1703
  },
1697
1704
  async flush() {
1698
- for (const namespace of [...held.keys()])
1699
- releaseHeld(namespace);
1700
- const waiting = [...pending.entries()];
1701
- for (const [id2, timer] of waiting) {
1702
- if (timer === void 0)
1703
- continue;
1704
- cancel(timer);
1705
- pending.delete(id2);
1706
- const delivery = deliveries.get(id2);
1707
- if (!delivery)
1708
- continue;
1709
- track(attempt(delivery).then((ok) => {
1710
- if (ok)
1711
- delivery.state = "delivered";
1712
- else
1713
- schedule(delivery);
1714
- }));
1705
+ for (; ; ) {
1706
+ for (const namespace of [...held.keys()])
1707
+ releaseHeld(namespace);
1708
+ const waiting = [...pending.entries()];
1709
+ for (const [id2, timer] of waiting) {
1710
+ if (timer === void 0)
1711
+ continue;
1712
+ cancel(timer);
1713
+ pending.delete(id2);
1714
+ const delivery = deliveries.get(id2);
1715
+ if (!delivery)
1716
+ continue;
1717
+ track(attempt(delivery).then((ok) => {
1718
+ if (ok)
1719
+ delivery.state = "delivered";
1720
+ else
1721
+ schedule(delivery);
1722
+ }));
1723
+ }
1724
+ await hub.idle();
1725
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
1726
+ if (held.size === 0 && !scheduled)
1727
+ return;
1715
1728
  }
1716
- await hub.idle();
1717
1729
  },
1718
1730
  async idle() {
1719
1731
  while (inFlight.size > 0)
@@ -2969,4 +2981,4 @@ export {
2969
2981
  LIVEKIT_NAMESPACE,
2970
2982
  LiveKitAPI
2971
2983
  };
2972
- //# sourceMappingURL=chunk-7ZW474B4.js.map
2984
+ //# sourceMappingURL=chunk-VTZE67GX.js.map