@crvouga/mockingbird-service-google-calendar 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-google-calendar
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
 
@@ -1590,7 +1590,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1590
1590
  };
1591
1591
 
1592
1592
  // ../core/dist/version.js
1593
- var PACKAGE_VERSION = true ? "1.0.1" : UNRELEASED_VERSION;
1593
+ var PACKAGE_VERSION = true ? "1.1.0" : UNRELEASED_VERSION;
1594
1594
 
1595
1595
  // ../core/dist/signing.js
1596
1596
  var encoder = new TextEncoder();
@@ -1683,6 +1683,7 @@ var createWebhookHub = (options) => {
1683
1683
  const faults = /* @__PURE__ */ new Map();
1684
1684
  const held = /* @__PURE__ */ new Map();
1685
1685
  const inFlight = /* @__PURE__ */ new Set();
1686
+ let immediate = Promise.resolve();
1686
1687
  const track = (work) => {
1687
1688
  inFlight.add(work);
1688
1689
  void work.finally(() => inFlight.delete(work));
@@ -1745,22 +1746,28 @@ var createWebhookHub = (options) => {
1745
1746
  pending.delete(delivery.id);
1746
1747
  return;
1747
1748
  }
1748
- const run = () => {
1749
- pending.delete(delivery.id);
1750
- track(attempt(delivery).then((ok) => {
1749
+ const settle = async () => {
1750
+ if (!payloads.has(delivery.id))
1751
+ return;
1752
+ await attempt(delivery).then((ok) => {
1751
1753
  if (ok)
1752
1754
  delivery.state = "delivered";
1753
1755
  else
1754
1756
  schedule(delivery);
1755
- }));
1757
+ });
1756
1758
  };
1757
1759
  const delay = delays[index] ?? 0;
1758
1760
  if (delay <= 0) {
1759
- pending.set(delivery.id, void 0);
1760
- run();
1761
+ const task = immediate.then(settle);
1762
+ immediate = task.catch(() => {
1763
+ });
1764
+ track(task);
1761
1765
  return;
1762
1766
  }
1763
- const timer = scheduleTimer(run, delay);
1767
+ const timer = scheduleTimer(() => {
1768
+ pending.delete(delivery.id);
1769
+ track(settle());
1770
+ }, delay);
1764
1771
  unref(timer);
1765
1772
  pending.set(delivery.id, timer);
1766
1773
  };
@@ -1856,25 +1863,30 @@ var createWebhookHub = (options) => {
1856
1863
  return delivery;
1857
1864
  },
1858
1865
  async flush() {
1859
- for (const namespace of [...held.keys()])
1860
- releaseHeld(namespace);
1861
- const waiting = [...pending.entries()];
1862
- for (const [id2, timer] of waiting) {
1863
- if (timer === void 0)
1864
- continue;
1865
- cancel(timer);
1866
- pending.delete(id2);
1867
- const delivery = deliveries.get(id2);
1868
- if (!delivery)
1869
- continue;
1870
- track(attempt(delivery).then((ok) => {
1871
- if (ok)
1872
- delivery.state = "delivered";
1873
- else
1874
- schedule(delivery);
1875
- }));
1866
+ for (; ; ) {
1867
+ for (const namespace of [...held.keys()])
1868
+ releaseHeld(namespace);
1869
+ const waiting = [...pending.entries()];
1870
+ for (const [id2, timer] of waiting) {
1871
+ if (timer === void 0)
1872
+ continue;
1873
+ cancel(timer);
1874
+ pending.delete(id2);
1875
+ const delivery = deliveries.get(id2);
1876
+ if (!delivery)
1877
+ continue;
1878
+ track(attempt(delivery).then((ok) => {
1879
+ if (ok)
1880
+ delivery.state = "delivered";
1881
+ else
1882
+ schedule(delivery);
1883
+ }));
1884
+ }
1885
+ await hub.idle();
1886
+ const scheduled = [...pending.values()].some((timer) => timer !== void 0);
1887
+ if (held.size === 0 && !scheduled)
1888
+ return;
1876
1889
  }
1877
- await hub.idle();
1878
1890
  },
1879
1891
  async idle() {
1880
1892
  while (inFlight.size > 0)
@@ -3636,4 +3648,4 @@ export {
3636
3648
  emailFromCode,
3637
3649
  GoogleCalendarAPI
3638
3650
  };
3639
- //# sourceMappingURL=chunk-PTCOC2XS.js.map
3651
+ //# sourceMappingURL=chunk-EXPHPCCV.js.map