@dxos/messaging 0.6.14-staging.e15392e → 0.7.1-staging.599df14

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.
@@ -1988,7 +1988,7 @@ _ts_decorate([
1988
1988
  ], WebsocketSignalManager.prototype, "checkServerFailure", null);
1989
1989
 
1990
1990
  // packages/core/mesh/messaging/src/signal-manager/edge-signal-manager.ts
1991
- import { Event as Event5 } from "@dxos/async";
1991
+ import { Event as Event5, scheduleMicroTask } from "@dxos/async";
1992
1992
  import { Resource as Resource3 } from "@dxos/context";
1993
1993
  import { protocol } from "@dxos/edge-client";
1994
1994
  import { invariant as invariant6 } from "@dxos/invariant";
@@ -2012,9 +2012,10 @@ var EdgeSignalManager = class extends Resource3 {
2012
2012
  this._edgeConnection = edgeConnection;
2013
2013
  }
2014
2014
  async _open() {
2015
- this._ctx.onDispose(this._edgeConnection.addListener((message) => this._onMessage(message)));
2016
- this._edgeConnection.reconnect.on(this._ctx, () => this._rejoinAllSwarms());
2017
- await this._rejoinAllSwarms();
2015
+ this._ctx.onDispose(this._edgeConnection.onMessage((message) => this._onMessage(message)));
2016
+ this._ctx.onDispose(this._edgeConnection.onReconnected(() => {
2017
+ scheduleMicroTask(this._ctx, () => this._rejoinAllSwarms());
2018
+ }));
2018
2019
  }
2019
2020
  /**
2020
2021
  * Warning: PeerInfo is inferred from edgeConnection.
@@ -2029,7 +2030,7 @@ var EdgeSignalManager = class extends Resource3 {
2029
2030
  }
2030
2031
  }, {
2031
2032
  F: __dxlog_file7,
2032
- L: 53,
2033
+ L: 56,
2033
2034
  S: this,
2034
2035
  C: (f, a) => f(...a)
2035
2036
  });
@@ -2069,7 +2070,7 @@ var EdgeSignalManager = class extends Resource3 {
2069
2070
  }
2070
2071
  }, {
2071
2072
  F: __dxlog_file7,
2072
- L: 86,
2073
+ L: 89,
2073
2074
  S: this,
2074
2075
  C: (f, a) => f(...a)
2075
2076
  });
@@ -2104,7 +2105,7 @@ var EdgeSignalManager = class extends Resource3 {
2104
2105
  _processSwarmResponse(message) {
2105
2106
  invariant6(protocol.getPayloadType(message) === SwarmResponseSchema.typeName, "Wrong payload type", {
2106
2107
  F: __dxlog_file7,
2107
- L: 123,
2108
+ L: 126,
2108
2109
  S: this,
2109
2110
  A: [
2110
2111
  "protocol.getPayloadType(message) === SwarmResponseSchema.typeName",
@@ -2118,7 +2119,7 @@ var EdgeSignalManager = class extends Resource3 {
2118
2119
  topic
2119
2120
  }, {
2120
2121
  F: __dxlog_file7,
2121
- L: 127,
2122
+ L: 130,
2122
2123
  S: this,
2123
2124
  C: (f, a) => f(...a)
2124
2125
  });
@@ -2155,7 +2156,7 @@ var EdgeSignalManager = class extends Resource3 {
2155
2156
  _processMessage(message) {
2156
2157
  invariant6(protocol.getPayloadType(message) === bufWkt.AnySchema.typeName, "Wrong payload type", {
2157
2158
  F: __dxlog_file7,
2158
- L: 160,
2159
+ L: 163,
2159
2160
  S: this,
2160
2161
  A: [
2161
2162
  "protocol.getPayloadType(message) === bufWkt.AnySchema.typeName",
@@ -2165,7 +2166,7 @@ var EdgeSignalManager = class extends Resource3 {
2165
2166
  const payload = protocol.getPayload(message, bufWkt.AnySchema);
2166
2167
  invariant6(message.source, "source is missing", {
2167
2168
  F: __dxlog_file7,
2168
- L: 162,
2169
+ L: 165,
2169
2170
  S: this,
2170
2171
  A: [
2171
2172
  "message.source",
@@ -2174,7 +2175,7 @@ var EdgeSignalManager = class extends Resource3 {
2174
2175
  });
2175
2176
  invariant6(message.target, "target is missing", {
2176
2177
  F: __dxlog_file7,
2177
- L: 163,
2178
+ L: 166,
2178
2179
  S: this,
2179
2180
  A: [
2180
2181
  "message.target",
@@ -2183,7 +2184,7 @@ var EdgeSignalManager = class extends Resource3 {
2183
2184
  });
2184
2185
  invariant6(message.target.length === 1, "target should have exactly one item", {
2185
2186
  F: __dxlog_file7,
2186
- L: 164,
2187
+ L: 167,
2187
2188
  S: this,
2188
2189
  A: [
2189
2190
  "message.target.length === 1",
@@ -2207,7 +2208,7 @@ var EdgeSignalManager = class extends Resource3 {
2207
2208
  swarms: Array.from(this._swarmPeers.keys())
2208
2209
  }, {
2209
2210
  F: __dxlog_file7,
2210
- L: 183,
2211
+ L: 186,
2211
2212
  S: this,
2212
2213
  C: (f, a) => f(...a)
2213
2214
  });
@@ -2297,4 +2298,4 @@ export {
2297
2298
  EdgeSignalManager,
2298
2299
  setIdentityTags
2299
2300
  };
2300
- //# sourceMappingURL=chunk-VEGUZODL.mjs.map
2301
+ //# sourceMappingURL=chunk-U5OG65N2.mjs.map