@crvouga/mockingbird-service-intercom 1.1.2 → 1.2.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-intercom
2
2
 
3
- ## 1.1.2 (2026-09-26)
3
+ ## 1.2.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.1.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-G2BMC225.js";
3
+ } from "./chunk-I2HUCC7I.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -375,4 +375,4 @@ export {
375
375
  createServer2 as createServer,
376
376
  serveTarget
377
377
  };
378
- //# sourceMappingURL=chunk-LKMXLCCL.js.map
378
+ //# sourceMappingURL=chunk-7KNGRKX7.js.map
@@ -1680,7 +1680,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1680
1680
  };
1681
1681
 
1682
1682
  // ../core/dist/version.js
1683
- var PACKAGE_VERSION = true ? "1.1.2" : UNRELEASED_VERSION;
1683
+ var PACKAGE_VERSION = true ? "1.2.0" : UNRELEASED_VERSION;
1684
1684
 
1685
1685
  // ../core/dist/signing.js
1686
1686
  var encoder = new TextEncoder();
@@ -1773,6 +1773,7 @@ var createWebhookHub = (options) => {
1773
1773
  const faults = /* @__PURE__ */ new Map();
1774
1774
  const held = /* @__PURE__ */ new Map();
1775
1775
  const inFlight2 = /* @__PURE__ */ new Set();
1776
+ let immediate = Promise.resolve();
1776
1777
  const track = (work) => {
1777
1778
  inFlight2.add(work);
1778
1779
  void work.finally(() => inFlight2.delete(work));
@@ -1835,22 +1836,28 @@ var createWebhookHub = (options) => {
1835
1836
  pending.delete(delivery.id);
1836
1837
  return;
1837
1838
  }
1838
- const run = () => {
1839
- pending.delete(delivery.id);
1840
- track(attempt(delivery).then((ok) => {
1839
+ const settle = async () => {
1840
+ if (!payloads.has(delivery.id))
1841
+ return;
1842
+ await attempt(delivery).then((ok) => {
1841
1843
  if (ok)
1842
1844
  delivery.state = "delivered";
1843
1845
  else
1844
1846
  schedule(delivery);
1845
- }));
1847
+ });
1846
1848
  };
1847
1849
  const delay = delays[index] ?? 0;
1848
1850
  if (delay <= 0) {
1849
- pending.set(delivery.id, void 0);
1850
- run();
1851
+ const task = immediate.then(settle);
1852
+ immediate = task.catch(() => {
1853
+ });
1854
+ track(task);
1851
1855
  return;
1852
1856
  }
1853
- const timer = scheduleTimer(run, delay);
1857
+ const timer = scheduleTimer(() => {
1858
+ pending.delete(delivery.id);
1859
+ track(settle());
1860
+ }, delay);
1854
1861
  unref(timer);
1855
1862
  pending.set(delivery.id, timer);
1856
1863
  };
@@ -1946,25 +1953,30 @@ var createWebhookHub = (options) => {
1946
1953
  return delivery;
1947
1954
  },
1948
1955
  async flush() {
1949
- for (const namespace of [...held.keys()])
1950
- releaseHeld(namespace);
1951
- const waiting = [...pending.entries()];
1952
- for (const [id2, timer] of waiting) {
1953
- if (timer === void 0)
1954
- continue;
1955
- cancel(timer);
1956
- pending.delete(id2);
1957
- const delivery = deliveries.get(id2);
1958
- if (!delivery)
1959
- continue;
1960
- track(attempt(delivery).then((ok) => {
1961
- if (ok)
1962
- delivery.state = "delivered";
1963
- else
1964
- schedule(delivery);
1965
- }));
1956
+ for (; ; ) {
1957
+ for (const namespace of [...held.keys()])
1958
+ releaseHeld(namespace);
1959
+ const waiting = [...pending.entries()];
1960
+ for (const [id2, timer] of waiting) {
1961
+ if (timer === void 0)
1962
+ continue;
1963
+ cancel(timer);
1964
+ pending.delete(id2);
1965
+ const delivery = deliveries.get(id2);
1966
+ if (!delivery)
1967
+ continue;
1968
+ track(attempt(delivery).then((ok) => {
1969
+ if (ok)
1970
+ delivery.state = "delivered";
1971
+ else
1972
+ schedule(delivery);
1973
+ }));
1974
+ }
1975
+ await hub.idle();
1976
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
1977
+ if (held.size === 0 && !scheduled)
1978
+ return;
1966
1979
  }
1967
- await hub.idle();
1968
1980
  },
1969
1981
  async idle() {
1970
1982
  while (inFlight2.size > 0)
@@ -4019,4 +4031,4 @@ export {
4019
4031
  IntercomError,
4020
4032
  IntercomAPI
4021
4033
  };
4022
- //# sourceMappingURL=chunk-G2BMC225.js.map
4034
+ //# sourceMappingURL=chunk-I2HUCC7I.js.map