@dxos/echo-pipeline 0.3.11-main.e26c0a5 → 0.3.11-main.e28df4f

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.
@@ -1602,22 +1602,23 @@ var DataPipeline = class {
1602
1602
  this._epochCtx = void 0;
1603
1603
  }
1604
1604
  async _consumePipeline() {
1605
+ const pipeline = this._pipeline;
1605
1606
  if (this.currentEpoch) {
1606
1607
  const waitForOneEpoch = this.onNewEpoch.waitForCount(1);
1607
1608
  await this._processEpochInSeparateTask(this.currentEpoch);
1608
1609
  await waitForOneEpoch;
1609
1610
  }
1610
1611
  let messageCounter = 0;
1611
- invariant8(this._pipeline, "Pipeline is not initialized.", {
1612
+ invariant8(pipeline, "Pipeline is not initialized.", {
1612
1613
  F: __dxlog_file9,
1613
- L: 228,
1614
+ L: 229,
1614
1615
  S: this,
1615
1616
  A: [
1616
- "this._pipeline",
1617
+ "pipeline",
1617
1618
  "'Pipeline is not initialized.'"
1618
1619
  ]
1619
1620
  });
1620
- for await (const msg of this._pipeline.consume()) {
1621
+ for await (const msg of pipeline.consume()) {
1621
1622
  const span = this._usage.beginRecording();
1622
1623
  this._mutations.inc();
1623
1624
  const { feedKey, seq, data } = msg;
@@ -1626,7 +1627,7 @@ var DataPipeline = class {
1626
1627
  seq
1627
1628
  }, {
1628
1629
  F: __dxlog_file9,
1629
- L: 234,
1630
+ L: 235,
1630
1631
  S: this,
1631
1632
  C: (f, a) => f(...a)
1632
1633
  });
@@ -1638,7 +1639,7 @@ var DataPipeline = class {
1638
1639
  feedKey
1639
1640
  }, {
1640
1641
  F: __dxlog_file9,
1641
- L: 240,
1642
+ L: 241,
1642
1643
  S: this,
1643
1644
  C: (f, a) => f(...a)
1644
1645
  });
@@ -1661,16 +1662,16 @@ var DataPipeline = class {
1661
1662
  spaceKey: this._params.spaceKey.toHex()
1662
1663
  }, {
1663
1664
  F: __dxlog_file9,
1664
- L: 257,
1665
+ L: 258,
1665
1666
  S: this,
1666
1667
  C: (f, a) => f(...a)
1667
1668
  });
1668
- await this._noteTargetStateIfNeeded(this._pipeline.state.pendingTimeframe);
1669
+ await this._noteTargetStateIfNeeded(pipeline.state.pendingTimeframe);
1669
1670
  }
1670
1671
  } catch (err) {
1671
1672
  log8.catch(err, void 0, {
1672
1673
  F: __dxlog_file9,
1673
- L: 267,
1674
+ L: 268,
1674
1675
  S: this,
1675
1676
  C: (f, a) => f(...a)
1676
1677
  });
@@ -1685,7 +1686,7 @@ var DataPipeline = class {
1685
1686
  _createSnapshot() {
1686
1687
  invariant8(this.databaseHost, "Database backend is not initialized.", {
1687
1688
  F: __dxlog_file9,
1688
- L: 281,
1689
+ L: 282,
1689
1690
  S: this,
1690
1691
  A: [
1691
1692
  "this.databaseHost",
@@ -1714,7 +1715,7 @@ var DataPipeline = class {
1714
1715
  } catch (err) {
1715
1716
  log8.warn("Failed to cache properties", err, {
1716
1717
  F: __dxlog_file9,
1717
- L: 310,
1718
+ L: 311,
1718
1719
  S: this,
1719
1720
  C: (f, a) => f(...a)
1720
1721
  });
@@ -1743,14 +1744,14 @@ var DataPipeline = class {
1743
1744
  if (err instanceof CancelledError) {
1744
1745
  log8("Epoch processing cancelled.", void 0, {
1745
1746
  F: __dxlog_file9,
1746
- L: 346,
1747
+ L: 347,
1747
1748
  S: this,
1748
1749
  C: (f, a) => f(...a)
1749
1750
  });
1750
1751
  } else {
1751
1752
  log8.catch(err, void 0, {
1752
1753
  F: __dxlog_file9,
1753
- L: 348,
1754
+ L: 349,
1754
1755
  S: this,
1755
1756
  C: (f, a) => f(...a)
1756
1757
  });
@@ -1773,7 +1774,7 @@ var DataPipeline = class {
1773
1774
  async _processEpoch(ctx, epoch) {
1774
1775
  invariant8(this._isOpen, "Space is closed.", {
1775
1776
  F: __dxlog_file9,
1776
- L: 372,
1777
+ L: 373,
1777
1778
  S: this,
1778
1779
  A: [
1779
1780
  "this._isOpen",
@@ -1782,7 +1783,7 @@ var DataPipeline = class {
1782
1783
  });
1783
1784
  invariant8(this._pipeline, void 0, {
1784
1785
  F: __dxlog_file9,
1785
- L: 373,
1786
+ L: 374,
1786
1787
  S: this,
1787
1788
  A: [
1788
1789
  "this._pipeline",
@@ -1794,7 +1795,7 @@ var DataPipeline = class {
1794
1795
  epoch: omit(epoch, "proof")
1795
1796
  }, {
1796
1797
  F: __dxlog_file9,
1797
- L: 376,
1798
+ L: 377,
1798
1799
  S: this,
1799
1800
  C: (f, a) => f(...a)
1800
1801
  });
@@ -1804,7 +1805,7 @@ var DataPipeline = class {
1804
1805
  }
1805
1806
  log8("restarting pipeline from epoch", void 0, {
1806
1807
  F: __dxlog_file9,
1807
- L: 382,
1808
+ L: 383,
1808
1809
  S: this,
1809
1810
  C: (f, a) => f(...a)
1810
1811
  });
@@ -1815,7 +1816,7 @@ var DataPipeline = class {
1815
1816
  async waitUntilTimeframe(timeframe) {
1816
1817
  invariant8(this._pipeline, "Pipeline is not initialized.", {
1817
1818
  F: __dxlog_file9,
1818
- L: 389,
1819
+ L: 390,
1819
1820
  S: this,
1820
1821
  A: [
1821
1822
  "this._pipeline",
@@ -1827,7 +1828,7 @@ var DataPipeline = class {
1827
1828
  async createEpoch() {
1828
1829
  invariant8(this._pipeline, void 0, {
1829
1830
  F: __dxlog_file9,
1830
- L: 395,
1831
+ L: 396,
1831
1832
  S: this,
1832
1833
  A: [
1833
1834
  "this._pipeline",
@@ -1836,7 +1837,7 @@ var DataPipeline = class {
1836
1837
  });
1837
1838
  invariant8(this.currentEpoch, void 0, {
1838
1839
  F: __dxlog_file9,
1839
- L: 396,
1840
+ L: 397,
1840
1841
  S: this,
1841
1842
  A: [
1842
1843
  "this.currentEpoch",
@@ -1867,7 +1868,7 @@ var DataPipeline = class {
1867
1868
  } catch (err) {
1868
1869
  log8.catch(err, void 0, {
1869
1870
  F: __dxlog_file9,
1870
- L: 426,
1871
+ L: 427,
1871
1872
  S: this,
1872
1873
  C: (f, a) => f(...a)
1873
1874
  });
@@ -1924,7 +1925,7 @@ var idle = async (timeout) => {
1924
1925
  };
1925
1926
 
1926
1927
  // packages/core/echo/echo-pipeline/src/space/space.ts
1927
- import { Event as Event5, synchronized as synchronized4, trackLeaks as trackLeaks3, Lock } from "@dxos/async";
1928
+ import { Event as Event5, synchronized as synchronized4, trackLeaks as trackLeaks3, Mutex } from "@dxos/async";
1928
1929
  import { invariant as invariant9 } from "@dxos/invariant";
1929
1930
  import { log as log10, logInfo } from "@dxos/log";
1930
1931
  import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
@@ -2203,7 +2204,7 @@ function _ts_decorate6(decorators, target, key, desc) {
2203
2204
  var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
2204
2205
  var Space = class {
2205
2206
  constructor(params) {
2206
- this._addFeedLock = new Lock();
2207
+ this._addFeedMutex = new Mutex();
2207
2208
  this.onCredentialProcessed = new Callback2();
2208
2209
  this.stateUpdate = new Event5();
2209
2210
  this._isOpen = false;
@@ -2273,7 +2274,7 @@ var Space = class {
2273
2274
  if (this._dataFeed) {
2274
2275
  pipeline.setWriteFeed(this._dataFeed);
2275
2276
  }
2276
- await this._addFeedLock.executeSynchronized(async () => {
2277
+ await this._addFeedMutex.executeSynchronized(async () => {
2277
2278
  for (const feed of this._controlPipeline.spaceState.feeds.values()) {
2278
2279
  if (feed.assertion.designation === AdmittedFeed2.Designation.DATA && !pipeline.hasFeed(feed.key)) {
2279
2280
  await pipeline.addFeed(await this._feedProvider(feed.key, {
@@ -2826,7 +2827,7 @@ var AutomergeHost = class {
2826
2827
  }
2827
2828
  try {
2828
2829
  if (!doc.experimental_spaceKey) {
2829
- log13.warn("space key not found for share policy check", {
2830
+ log13("space key not found for share policy check", {
2830
2831
  peerId,
2831
2832
  documentId
2832
2833
  }, {
@@ -2841,7 +2842,7 @@ var AutomergeHost = class {
2841
2842
  const authorizedDevices = this._authorizedDevices.get(spaceKey);
2842
2843
  const deviceKeyHex = this.repo.peerMetadataByPeerId[peerId]?.dxos_deviceKey;
2843
2844
  if (!deviceKeyHex) {
2844
- log13.warn("device key not found for share policy check", {
2845
+ log13("device key not found for share policy check", {
2845
2846
  peerId,
2846
2847
  documentId
2847
2848
  }, {
@@ -2854,7 +2855,7 @@ var AutomergeHost = class {
2854
2855
  }
2855
2856
  const deviceKey = PublicKey8.from(deviceKeyHex);
2856
2857
  const isAuthorized = authorizedDevices?.has(deviceKey) ?? false;
2857
- log13.info("share policy check", {
2858
+ log13("share policy check", {
2858
2859
  peerId,
2859
2860
  documentId,
2860
2861
  deviceKey,
@@ -3226,4 +3227,4 @@ export {
3226
3227
  SpaceManager,
3227
3228
  AutomergeHost
3228
3229
  };
3229
- //# sourceMappingURL=chunk-CTE522SL.mjs.map
3230
+ //# sourceMappingURL=chunk-D7UMNYLJ.mjs.map