@dxos/messaging 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a

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.
@@ -2087,7 +2087,7 @@ _ts_decorate([
2087
2087
  // src/signal-manager/edge-signal-manager.ts
2088
2088
  import { Event as Event5, scheduleMicroTask } from "@dxos/async";
2089
2089
  import { Resource as Resource3, cancelWithContext as cancelWithContext3 } from "@dxos/context";
2090
- import { protocol } from "@dxos/edge-client";
2090
+ import { EdgeIdentityChangedError, protocol } from "@dxos/edge-client";
2091
2091
  import { invariant as invariant6 } from "@dxos/invariant";
2092
2092
  import { PublicKey as PublicKey7 } from "@dxos/keys";
2093
2093
  import { log as log7 } from "@dxos/log";
@@ -2153,16 +2153,23 @@ var EdgeSignalManager = class extends Resource3 {
2153
2153
  }
2154
2154
  async leave({ topic, peer }) {
2155
2155
  this._swarmPeers.delete(topic);
2156
- await this._edgeConnection.send(protocol.createMessage(SwarmRequestSchema, {
2157
- serviceId: EdgeService.SWARM,
2158
- source: createMessageSource(topic, peer),
2159
- payload: {
2160
- action: SwarmRequestAction.LEAVE,
2161
- swarmKeys: [
2162
- topic.toHex()
2163
- ]
2156
+ try {
2157
+ await this._edgeConnection.send(protocol.createMessage(SwarmRequestSchema, {
2158
+ serviceId: EdgeService.SWARM,
2159
+ source: createMessageSource(topic, peer),
2160
+ payload: {
2161
+ action: SwarmRequestAction.LEAVE,
2162
+ swarmKeys: [
2163
+ topic.toHex()
2164
+ ]
2165
+ }
2166
+ }));
2167
+ } catch (err) {
2168
+ if (err instanceof EdgeIdentityChangedError) {
2169
+ return;
2164
2170
  }
2165
- }));
2171
+ throw err;
2172
+ }
2166
2173
  }
2167
2174
  async query({ topic }) {
2168
2175
  const response = cancelWithContext3(this._ctx, this.swarmState.waitFor((state) => state.swarmKey === topic.toHex()));
@@ -2191,7 +2198,7 @@ var EdgeSignalManager = class extends Resource3 {
2191
2198
  }
2192
2199
  }, {
2193
2200
  F: __dxlog_file7,
2194
- L: 122,
2201
+ L: 131,
2195
2202
  S: this,
2196
2203
  C: (f, a) => f(...a)
2197
2204
  });
@@ -2226,7 +2233,7 @@ var EdgeSignalManager = class extends Resource3 {
2226
2233
  _processSwarmResponse(message) {
2227
2234
  invariant6(protocol.getPayloadType(message) === SwarmResponseSchema.typeName, "Wrong payload type", {
2228
2235
  F: __dxlog_file7,
2229
- L: 159,
2236
+ L: 168,
2230
2237
  S: this,
2231
2238
  A: [
2232
2239
  "protocol.getPayloadType(message) === SwarmResponseSchema.typeName",
@@ -2270,7 +2277,7 @@ var EdgeSignalManager = class extends Resource3 {
2270
2277
  _processMessage(message) {
2271
2278
  invariant6(protocol.getPayloadType(message) === bufWkt.AnySchema.typeName, "Wrong payload type", {
2272
2279
  F: __dxlog_file7,
2273
- L: 197,
2280
+ L: 206,
2274
2281
  S: this,
2275
2282
  A: [
2276
2283
  "protocol.getPayloadType(message) === bufWkt.AnySchema.typeName",
@@ -2280,7 +2287,7 @@ var EdgeSignalManager = class extends Resource3 {
2280
2287
  const payload = protocol.getPayload(message, bufWkt.AnySchema);
2281
2288
  invariant6(message.source, "source is missing", {
2282
2289
  F: __dxlog_file7,
2283
- L: 199,
2290
+ L: 208,
2284
2291
  S: this,
2285
2292
  A: [
2286
2293
  "message.source",
@@ -2289,7 +2296,7 @@ var EdgeSignalManager = class extends Resource3 {
2289
2296
  });
2290
2297
  invariant6(message.target, "target is missing", {
2291
2298
  F: __dxlog_file7,
2292
- L: 200,
2299
+ L: 209,
2293
2300
  S: this,
2294
2301
  A: [
2295
2302
  "message.target",
@@ -2298,7 +2305,7 @@ var EdgeSignalManager = class extends Resource3 {
2298
2305
  });
2299
2306
  invariant6(message.target.length === 1, "target should have exactly one item", {
2300
2307
  F: __dxlog_file7,
2301
- L: 201,
2308
+ L: 210,
2302
2309
  S: this,
2303
2310
  A: [
2304
2311
  "message.target.length === 1",
@@ -2322,7 +2329,7 @@ var EdgeSignalManager = class extends Resource3 {
2322
2329
  swarms: Array.from(this._swarmPeers.keys())
2323
2330
  }, {
2324
2331
  F: __dxlog_file7,
2325
- L: 220,
2332
+ L: 229,
2326
2333
  S: this,
2327
2334
  C: (f, a) => f(...a)
2328
2335
  });
@@ -2423,4 +2430,4 @@ export {
2423
2430
  EdgeSignalManager,
2424
2431
  setIdentityTags
2425
2432
  };
2426
- //# sourceMappingURL=chunk-46VUJLOF.mjs.map
2433
+ //# sourceMappingURL=chunk-CD3GXEDZ.mjs.map