@dxos/network-manager 0.1.53-main.55faa2f → 0.1.53-main.5bcfb84
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/dist/lib/browser/{chunk-SA5ALANV.mjs → chunk-N5RZB7V4.mjs} +451 -439
- package/dist/lib/browser/{chunk-SA5ALANV.mjs.map → chunk-N5RZB7V4.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +10 -9
- package/dist/lib/browser/testing/index.mjs.map +1 -1
- package/dist/lib/node/index.cjs +450 -438
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +413 -402
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/package.json +18 -18
|
@@ -70,7 +70,7 @@ var import_errors = require("@dxos/errors");
|
|
|
70
70
|
var import_keys = require("@dxos/keys");
|
|
71
71
|
var import_log = require("@dxos/log");
|
|
72
72
|
var import_protocols = require("@dxos/protocols");
|
|
73
|
-
|
|
73
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
74
74
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
75
75
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
76
76
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -79,7 +79,8 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
79
79
|
if (d = decorators[i])
|
|
80
80
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
81
81
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection.ts";
|
|
83
84
|
var STARTING_SIGNALLING_DELAY = 10;
|
|
84
85
|
var MAX_SIGNALLING_DELAY = 300;
|
|
85
86
|
var ConnectionState;
|
|
@@ -156,21 +157,21 @@ var Connection = class {
|
|
|
156
157
|
import_log.log.trace("dxos.mesh.connection.open-connection", import_protocols.trace.begin({
|
|
157
158
|
id: this._instanceId
|
|
158
159
|
}), {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
F: __dxlog_file,
|
|
161
|
+
L: 115,
|
|
162
|
+
S: this,
|
|
163
|
+
C: (f, a) => f(...a)
|
|
163
164
|
});
|
|
164
165
|
this._changeState(ConnectionState.CONNECTING);
|
|
165
166
|
this._protocol.initialize().catch((err) => {
|
|
166
167
|
this.errors.raise(err);
|
|
167
168
|
});
|
|
168
169
|
this._protocol.stream.on("close", () => {
|
|
169
|
-
(0, import_log.log)("protocol stream closed",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
(0, import_log.log)("protocol stream closed", void 0, {
|
|
171
|
+
F: __dxlog_file,
|
|
172
|
+
L: 126,
|
|
173
|
+
S: this,
|
|
174
|
+
C: (f, a) => f(...a)
|
|
174
175
|
});
|
|
175
176
|
this.close().catch((err) => this.errors.raise(err));
|
|
176
177
|
});
|
|
@@ -199,10 +200,10 @@ var Connection = class {
|
|
|
199
200
|
import_log.log.trace("dxos.mesh.connection.open-connection", import_protocols.trace.end({
|
|
200
201
|
id: this._instanceId
|
|
201
202
|
}), {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
F: __dxlog_file,
|
|
204
|
+
L: 159,
|
|
205
|
+
S: this,
|
|
206
|
+
C: (f, a) => f(...a)
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
209
|
async close() {
|
|
@@ -215,38 +216,38 @@ var Connection = class {
|
|
|
215
216
|
(0, import_log.log)("closing...", {
|
|
216
217
|
peerId: this.ownId
|
|
217
218
|
}, {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
F: __dxlog_file,
|
|
220
|
+
L: 171,
|
|
221
|
+
S: this,
|
|
222
|
+
C: (f, a) => f(...a)
|
|
222
223
|
});
|
|
223
224
|
try {
|
|
224
225
|
await this._protocol.destroy();
|
|
225
226
|
} catch (err) {
|
|
226
|
-
import_log.log.catch(err,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
import_log.log.catch(err, void 0, {
|
|
228
|
+
F: __dxlog_file,
|
|
229
|
+
L: 177,
|
|
230
|
+
S: this,
|
|
231
|
+
C: (f, a) => f(...a)
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
234
|
try {
|
|
234
235
|
await ((_a2 = this._transport) == null ? void 0 : _a2.destroy());
|
|
235
|
-
} catch (
|
|
236
|
-
import_log.log.catch(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
} catch (err) {
|
|
237
|
+
import_log.log.catch(err, void 0, {
|
|
238
|
+
F: __dxlog_file,
|
|
239
|
+
L: 184,
|
|
240
|
+
S: this,
|
|
241
|
+
C: (f, a) => f(...a)
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
(0, import_log.log)("closed", {
|
|
244
245
|
peerId: this.ownId
|
|
245
246
|
}, {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
F: __dxlog_file,
|
|
248
|
+
L: 187,
|
|
249
|
+
S: this,
|
|
250
|
+
C: (f, a) => f(...a)
|
|
250
251
|
});
|
|
251
252
|
this._changeState(ConnectionState.CLOSED);
|
|
252
253
|
}
|
|
@@ -283,10 +284,10 @@ var Connection = class {
|
|
|
283
284
|
import_log.log.warn("Signal failed", {
|
|
284
285
|
err
|
|
285
286
|
}, {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
F: __dxlog_file,
|
|
288
|
+
L: 221,
|
|
289
|
+
S: this,
|
|
290
|
+
C: (f, a) => f(...a)
|
|
290
291
|
});
|
|
291
292
|
await this.close();
|
|
292
293
|
}
|
|
@@ -298,11 +299,11 @@ var Connection = class {
|
|
|
298
299
|
var _a2, _b, _c;
|
|
299
300
|
(0, import_tiny_invariant.default)(msg.sessionId);
|
|
300
301
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
301
|
-
(0, import_log.log)("dropping signal for incorrect session id",
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
(0, import_log.log)("dropping signal for incorrect session id", void 0, {
|
|
303
|
+
F: __dxlog_file,
|
|
304
|
+
L: 232,
|
|
305
|
+
S: this,
|
|
306
|
+
C: (f, a) => f(...a)
|
|
306
307
|
});
|
|
307
308
|
return;
|
|
308
309
|
}
|
|
@@ -322,10 +323,10 @@ var Connection = class {
|
|
|
322
323
|
remoteId: this.remoteId,
|
|
323
324
|
msg: msg.data
|
|
324
325
|
}, {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
F: __dxlog_file,
|
|
327
|
+
L: 246,
|
|
328
|
+
S: this,
|
|
329
|
+
C: (f, a) => f(...a)
|
|
329
330
|
});
|
|
330
331
|
this._incomingSignalBuffer.push(signal);
|
|
331
332
|
} else {
|
|
@@ -335,10 +336,10 @@ var Connection = class {
|
|
|
335
336
|
remoteId: this.remoteId,
|
|
336
337
|
msg: msg.data
|
|
337
338
|
}, {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
F: __dxlog_file,
|
|
340
|
+
L: 250,
|
|
341
|
+
S: this,
|
|
342
|
+
C: (f, a) => f(...a)
|
|
342
343
|
});
|
|
343
344
|
await this._transport.signal(signal);
|
|
344
345
|
}
|
|
@@ -350,17 +351,17 @@ var Connection = class {
|
|
|
350
351
|
too: state,
|
|
351
352
|
peerId: this.ownId
|
|
352
353
|
}, {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
354
|
+
F: __dxlog_file,
|
|
355
|
+
L: 257,
|
|
356
|
+
S: this,
|
|
357
|
+
C: (f, a) => f(...a)
|
|
357
358
|
});
|
|
358
359
|
(0, import_tiny_invariant.default)(state !== this._state, "Already in this state.");
|
|
359
360
|
this._state = state;
|
|
360
361
|
this.stateChanged.emit(state);
|
|
361
362
|
}
|
|
362
363
|
};
|
|
363
|
-
|
|
364
|
+
_ts_decorate([
|
|
364
365
|
import_async.synchronized
|
|
365
366
|
], Connection.prototype, "close", null);
|
|
366
367
|
|
|
@@ -381,6 +382,7 @@ var import_keys2 = require("@dxos/keys");
|
|
|
381
382
|
var import_log2 = require("@dxos/log");
|
|
382
383
|
var import_protocols2 = require("@dxos/protocols");
|
|
383
384
|
var import_util = require("@dxos/util");
|
|
385
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/signal/swarm-messenger.ts";
|
|
384
386
|
var SwarmMessenger = class {
|
|
385
387
|
constructor({ sendMessage, onSignal, onOffer, topic }) {
|
|
386
388
|
this._ctx = new import_context2.Context();
|
|
@@ -404,10 +406,10 @@ var SwarmMessenger = class {
|
|
|
404
406
|
to: recipient,
|
|
405
407
|
msg: message
|
|
406
408
|
}, {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
F: __dxlog_file2,
|
|
410
|
+
L: 68,
|
|
411
|
+
S: this,
|
|
412
|
+
C: (f, a) => f(...a)
|
|
411
413
|
});
|
|
412
414
|
if ((_a2 = message.data) == null ? void 0 : _a2.offer) {
|
|
413
415
|
await this._handleOffer({
|
|
@@ -433,10 +435,10 @@ var SwarmMessenger = class {
|
|
|
433
435
|
import_log2.log.warn("unknown message", {
|
|
434
436
|
message
|
|
435
437
|
}, {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
F: __dxlog_file2,
|
|
439
|
+
L: 79,
|
|
440
|
+
S: this,
|
|
441
|
+
C: (f, a) => f(...a)
|
|
440
442
|
});
|
|
441
443
|
}
|
|
442
444
|
}
|
|
@@ -477,10 +479,10 @@ var SwarmMessenger = class {
|
|
|
477
479
|
to: recipient,
|
|
478
480
|
msg: networkMessage
|
|
479
481
|
}, {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
F: __dxlog_file2,
|
|
483
|
+
L: 122,
|
|
484
|
+
S: this,
|
|
485
|
+
C: (f, a) => f(...a)
|
|
484
486
|
});
|
|
485
487
|
await this._sendMessage({
|
|
486
488
|
author,
|
|
@@ -501,10 +503,10 @@ var SwarmMessenger = class {
|
|
|
501
503
|
(0, import_log2.log)("resolving", {
|
|
502
504
|
answer: message.data.answer
|
|
503
505
|
}, {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
F: __dxlog_file2,
|
|
507
|
+
L: 139,
|
|
508
|
+
S: this,
|
|
509
|
+
C: (f, a) => f(...a)
|
|
508
510
|
});
|
|
509
511
|
offerRecord.resolve(message.data.answer);
|
|
510
512
|
}
|
|
@@ -537,10 +539,10 @@ var SwarmMessenger = class {
|
|
|
537
539
|
import_log2.log.warn("error sending answer", {
|
|
538
540
|
err
|
|
539
541
|
}, {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
F: __dxlog_file2,
|
|
543
|
+
L: 173,
|
|
544
|
+
S: this,
|
|
545
|
+
C: (f, a) => f(...a)
|
|
544
546
|
});
|
|
545
547
|
}
|
|
546
548
|
}
|
|
@@ -566,7 +568,7 @@ var import_async2 = require("@dxos/async");
|
|
|
566
568
|
var import_context3 = require("@dxos/context");
|
|
567
569
|
var import_keys3 = require("@dxos/keys");
|
|
568
570
|
var import_log3 = require("@dxos/log");
|
|
569
|
-
|
|
571
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
570
572
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
571
573
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
572
574
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -575,7 +577,8 @@ var __decorate2 = function(decorators, target, key, desc) {
|
|
|
575
577
|
if (d = decorators[i])
|
|
576
578
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
577
579
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
578
|
-
}
|
|
580
|
+
}
|
|
581
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/peer.ts";
|
|
579
582
|
var CONNECTION_COUNTS_STABLE_AFTER = 5e3;
|
|
580
583
|
var Peer = class {
|
|
581
584
|
constructor(id, topic, localPeerId, _signalMessaging, _protocolProvider, _transportFactory, _callbacks) {
|
|
@@ -604,10 +607,10 @@ var Peer = class {
|
|
|
604
607
|
topic: this.topic,
|
|
605
608
|
peerId: this.localPeerId
|
|
606
609
|
}, {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
610
|
+
F: __dxlog_file3,
|
|
611
|
+
L: 105,
|
|
612
|
+
S: this,
|
|
613
|
+
C: (f, a) => f(...a)
|
|
611
614
|
});
|
|
612
615
|
if (this.connection) {
|
|
613
616
|
await this.closeConnection();
|
|
@@ -631,10 +634,10 @@ var Peer = class {
|
|
|
631
634
|
remoteId: this.id,
|
|
632
635
|
err
|
|
633
636
|
}, {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
637
|
+
F: __dxlog_file3,
|
|
638
|
+
L: 129,
|
|
639
|
+
S: this,
|
|
640
|
+
C: (f, a) => f(...a)
|
|
638
641
|
});
|
|
639
642
|
await this.closeConnection();
|
|
640
643
|
}
|
|
@@ -660,10 +663,10 @@ var Peer = class {
|
|
|
660
663
|
peerId: this.id,
|
|
661
664
|
sessionId
|
|
662
665
|
}, {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
666
|
+
F: __dxlog_file3,
|
|
667
|
+
L: 147,
|
|
668
|
+
S: this,
|
|
669
|
+
C: (f, a) => f(...a)
|
|
667
670
|
});
|
|
668
671
|
const connection = this._createConnection(true, sessionId);
|
|
669
672
|
this.initiating = true;
|
|
@@ -683,17 +686,17 @@ var Peer = class {
|
|
|
683
686
|
ownId: this.localPeerId,
|
|
684
687
|
remoteId: this.id
|
|
685
688
|
}, {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
689
|
+
F: __dxlog_file3,
|
|
690
|
+
L: 159,
|
|
691
|
+
S: this,
|
|
692
|
+
C: (f, a) => f(...a)
|
|
690
693
|
});
|
|
691
694
|
if (connection.state !== ConnectionState.INITIAL) {
|
|
692
|
-
(0, import_log3.log)("ignoring response",
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
(0, import_log3.log)("ignoring response", void 0, {
|
|
696
|
+
F: __dxlog_file3,
|
|
697
|
+
L: 161,
|
|
698
|
+
S: this,
|
|
699
|
+
C: (f, a) => f(...a)
|
|
697
700
|
});
|
|
698
701
|
return;
|
|
699
702
|
}
|
|
@@ -710,10 +713,10 @@ var Peer = class {
|
|
|
710
713
|
peerId: this.localPeerId,
|
|
711
714
|
remoteId: this.id
|
|
712
715
|
}, {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
716
|
+
F: __dxlog_file3,
|
|
717
|
+
L: 172,
|
|
718
|
+
S: this,
|
|
719
|
+
C: (f, a) => f(...a)
|
|
717
720
|
});
|
|
718
721
|
await this.closeConnection();
|
|
719
722
|
throw err;
|
|
@@ -734,10 +737,10 @@ var Peer = class {
|
|
|
734
737
|
initiator,
|
|
735
738
|
sessionId
|
|
736
739
|
}, {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
740
|
+
F: __dxlog_file3,
|
|
741
|
+
L: 186,
|
|
742
|
+
S: this,
|
|
743
|
+
C: (f, a) => f(...a)
|
|
741
744
|
});
|
|
742
745
|
(0, import_tiny_invariant3.default)(!this.connection, "Already connected.");
|
|
743
746
|
const connection = new Connection(
|
|
@@ -774,10 +777,10 @@ var Peer = class {
|
|
|
774
777
|
remoteId: this.id,
|
|
775
778
|
initiator
|
|
776
779
|
}, {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
780
|
+
F: __dxlog_file3,
|
|
781
|
+
L: 221,
|
|
782
|
+
S: this,
|
|
783
|
+
C: (f, a) => f(...a)
|
|
781
784
|
});
|
|
782
785
|
(0, import_tiny_invariant3.default)(this.connection === connection, "Connection mismatch (race condition).");
|
|
783
786
|
if (this._lastConnectionTime && this._lastConnectionTime + CONNECTION_COUNTS_STABLE_AFTER < Date.now()) {
|
|
@@ -804,10 +807,10 @@ var Peer = class {
|
|
|
804
807
|
initiator,
|
|
805
808
|
err
|
|
806
809
|
}, {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
810
|
+
F: __dxlog_file3,
|
|
811
|
+
L: 249,
|
|
812
|
+
S: this,
|
|
813
|
+
C: (f, a) => f(...a)
|
|
811
814
|
});
|
|
812
815
|
void this.closeConnection();
|
|
813
816
|
});
|
|
@@ -823,20 +826,20 @@ var Peer = class {
|
|
|
823
826
|
peerId: this.id,
|
|
824
827
|
sessionId: connection.sessionId
|
|
825
828
|
}, {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
829
|
+
F: __dxlog_file3,
|
|
830
|
+
L: 265,
|
|
831
|
+
S: this,
|
|
832
|
+
C: (f, a) => f(...a)
|
|
830
833
|
});
|
|
831
834
|
await connection.close();
|
|
832
835
|
(0, import_log3.log)("closed", {
|
|
833
836
|
peerId: this.id,
|
|
834
837
|
sessionId: connection.sessionId
|
|
835
838
|
}, {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
839
|
+
F: __dxlog_file3,
|
|
840
|
+
L: 271,
|
|
841
|
+
S: this,
|
|
842
|
+
C: (f, a) => f(...a)
|
|
840
843
|
});
|
|
841
844
|
}
|
|
842
845
|
async onSignal(message) {
|
|
@@ -844,10 +847,10 @@ var Peer = class {
|
|
|
844
847
|
(0, import_log3.log)("dropping signal message for non-existent connection", {
|
|
845
848
|
message
|
|
846
849
|
}, {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
850
|
+
F: __dxlog_file3,
|
|
851
|
+
L: 276,
|
|
852
|
+
S: this,
|
|
853
|
+
C: (f, a) => f(...a)
|
|
851
854
|
});
|
|
852
855
|
return;
|
|
853
856
|
}
|
|
@@ -860,15 +863,15 @@ var Peer = class {
|
|
|
860
863
|
peerId: this.id,
|
|
861
864
|
topic: this.topic
|
|
862
865
|
}, {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
866
|
+
F: __dxlog_file3,
|
|
867
|
+
L: 285,
|
|
868
|
+
S: this,
|
|
869
|
+
C: (f, a) => f(...a)
|
|
867
870
|
});
|
|
868
871
|
await ((_a2 = this == null ? void 0 : this.connection) == null ? void 0 : _a2.close());
|
|
869
872
|
}
|
|
870
873
|
};
|
|
871
|
-
|
|
874
|
+
_ts_decorate2([
|
|
872
875
|
import_async2.synchronized
|
|
873
876
|
], Peer.prototype, "destroy", null);
|
|
874
877
|
var increaseInterval = (interval) => {
|
|
@@ -885,7 +888,7 @@ var increaseInterval = (interval) => {
|
|
|
885
888
|
};
|
|
886
889
|
|
|
887
890
|
// packages/core/mesh/network-manager/src/swarm/swarm.ts
|
|
888
|
-
|
|
891
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
889
892
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
890
893
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
891
894
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -894,7 +897,8 @@ var __decorate3 = function(decorators, target, key, desc) {
|
|
|
894
897
|
if (d = decorators[i])
|
|
895
898
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
896
899
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
897
|
-
}
|
|
900
|
+
}
|
|
901
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm.ts";
|
|
898
902
|
var INITIATION_DELAY = 100;
|
|
899
903
|
var getClassName = (obj) => Object.getPrototypeOf(obj).constructor.name;
|
|
900
904
|
var Swarm = class {
|
|
@@ -911,11 +915,11 @@ var Swarm = class {
|
|
|
911
915
|
this._peers = new import_util2.ComplexMap(import_keys4.PublicKey.hash);
|
|
912
916
|
this._ctx = new import_context4.Context();
|
|
913
917
|
this._listeningHandle = void 0;
|
|
918
|
+
this._instanceId = import_keys4.PublicKey.random().toHex();
|
|
914
919
|
this.connectionAdded = new import_async3.Event();
|
|
915
920
|
this.disconnected = new import_async3.Event();
|
|
916
921
|
this.connected = new import_async3.Event();
|
|
917
922
|
this.errors = new import_debug2.ErrorStream();
|
|
918
|
-
this._instanceId = import_keys4.PublicKey.random().toHex();
|
|
919
923
|
import_log4.log.trace("dxos.mesh.swarm.constructor", import_protocols3.trace.begin({
|
|
920
924
|
id: this._instanceId,
|
|
921
925
|
data: {
|
|
@@ -923,18 +927,18 @@ var Swarm = class {
|
|
|
923
927
|
peerId: this._ownPeerId.toHex()
|
|
924
928
|
}
|
|
925
929
|
}), {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
+
F: __dxlog_file4,
|
|
931
|
+
L: 86,
|
|
932
|
+
S: this,
|
|
933
|
+
C: (f, a) => f(...a)
|
|
930
934
|
});
|
|
931
935
|
(0, import_log4.log)("creating swarm", {
|
|
932
936
|
peerId: _ownPeerId
|
|
933
937
|
}, {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
+
F: __dxlog_file4,
|
|
939
|
+
L: 90,
|
|
940
|
+
S: this,
|
|
941
|
+
C: (f, a) => f(...a)
|
|
938
942
|
});
|
|
939
943
|
_topology.init(this._getSwarmController());
|
|
940
944
|
this._swarmMessenger = new SwarmMessenger({
|
|
@@ -946,10 +950,10 @@ var Swarm = class {
|
|
|
946
950
|
import_log4.log.trace("dxos.mesh.swarm.constructor", import_protocols3.trace.end({
|
|
947
951
|
id: this._instanceId
|
|
948
952
|
}), {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
+
F: __dxlog_file4,
|
|
954
|
+
L: 99,
|
|
955
|
+
S: this,
|
|
956
|
+
C: (f, a) => f(...a)
|
|
953
957
|
});
|
|
954
958
|
}
|
|
955
959
|
get connections() {
|
|
@@ -976,32 +980,32 @@ var Swarm = class {
|
|
|
976
980
|
await this._swarmMessenger.receiveMessage(message).catch((err) => import_log4.log.warn("Error while receiving message", {
|
|
977
981
|
err
|
|
978
982
|
}, {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
+
F: __dxlog_file4,
|
|
984
|
+
L: 133,
|
|
985
|
+
S: this,
|
|
986
|
+
C: (f, a) => f(...a)
|
|
983
987
|
}));
|
|
984
988
|
}
|
|
985
989
|
});
|
|
986
990
|
}
|
|
987
991
|
async destroy() {
|
|
988
992
|
var _a2;
|
|
989
|
-
(0, import_log4.log)("destroying...",
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
993
|
+
(0, import_log4.log)("destroying...", void 0, {
|
|
994
|
+
F: __dxlog_file4,
|
|
995
|
+
L: 139,
|
|
996
|
+
S: this,
|
|
997
|
+
C: (f, a) => f(...a)
|
|
994
998
|
});
|
|
995
999
|
await ((_a2 = this._listeningHandle) == null ? void 0 : _a2.unsubscribe());
|
|
996
1000
|
this._listeningHandle = void 0;
|
|
997
1001
|
await this._ctx.dispose();
|
|
998
1002
|
await this._topology.destroy();
|
|
999
1003
|
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key)));
|
|
1000
|
-
(0, import_log4.log)("destroyed",
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1004
|
+
(0, import_log4.log)("destroyed", void 0, {
|
|
1005
|
+
F: __dxlog_file4,
|
|
1006
|
+
L: 146,
|
|
1007
|
+
S: this,
|
|
1008
|
+
C: (f, a) => f(...a)
|
|
1005
1009
|
});
|
|
1006
1010
|
}
|
|
1007
1011
|
async setTopology(topology) {
|
|
@@ -1013,10 +1017,10 @@ var Swarm = class {
|
|
|
1013
1017
|
previous: getClassName(this._topology),
|
|
1014
1018
|
topology: getClassName(topology)
|
|
1015
1019
|
}, {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
+
F: __dxlog_file4,
|
|
1021
|
+
L: 154,
|
|
1022
|
+
S: this,
|
|
1023
|
+
C: (f, a) => f(...a)
|
|
1020
1024
|
});
|
|
1021
1025
|
await this._topology.destroy();
|
|
1022
1026
|
this._topology = topology;
|
|
@@ -1028,17 +1032,17 @@ var Swarm = class {
|
|
|
1028
1032
|
(0, import_log4.log)("swarm event", {
|
|
1029
1033
|
swarmEvent
|
|
1030
1034
|
}, {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
+
F: __dxlog_file4,
|
|
1036
|
+
L: 167,
|
|
1037
|
+
S: this,
|
|
1038
|
+
C: (f, a) => f(...a)
|
|
1035
1039
|
});
|
|
1036
1040
|
if (this._ctx.disposed) {
|
|
1037
|
-
(0, import_log4.log)("swarm event ignored for disposed swarm",
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1041
|
+
(0, import_log4.log)("swarm event ignored for disposed swarm", void 0, {
|
|
1042
|
+
F: __dxlog_file4,
|
|
1043
|
+
L: 170,
|
|
1044
|
+
S: this,
|
|
1045
|
+
C: (f, a) => f(...a)
|
|
1042
1046
|
});
|
|
1043
1047
|
return;
|
|
1044
1048
|
}
|
|
@@ -1047,25 +1051,25 @@ var Swarm = class {
|
|
|
1047
1051
|
(0, import_log4.log)("new peer", {
|
|
1048
1052
|
peerId
|
|
1049
1053
|
}, {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
+
F: __dxlog_file4,
|
|
1055
|
+
L: 176,
|
|
1056
|
+
S: this,
|
|
1057
|
+
C: (f, a) => f(...a)
|
|
1054
1058
|
});
|
|
1055
1059
|
if (!peerId.equals(this._ownPeerId)) {
|
|
1056
1060
|
const peer = this._getOrCreatePeer(peerId);
|
|
1057
1061
|
peer.advertizing = true;
|
|
1058
1062
|
}
|
|
1059
1063
|
} else if (swarmEvent.peerLeft) {
|
|
1060
|
-
const
|
|
1061
|
-
if (
|
|
1062
|
-
|
|
1063
|
-
if (((_a2 =
|
|
1064
|
-
void this._destroyPeer(
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1064
|
+
const peer = this._peers.get(import_keys4.PublicKey.from(swarmEvent.peerLeft.peer));
|
|
1065
|
+
if (peer) {
|
|
1066
|
+
peer.advertizing = false;
|
|
1067
|
+
if (((_a2 = peer.connection) == null ? void 0 : _a2.state) !== ConnectionState.CONNECTED) {
|
|
1068
|
+
void this._destroyPeer(peer.id).catch((err) => import_log4.log.catch(err, void 0, {
|
|
1069
|
+
F: __dxlog_file4,
|
|
1070
|
+
L: 187,
|
|
1071
|
+
S: this,
|
|
1072
|
+
C: (f, a) => f(...a)
|
|
1069
1073
|
}));
|
|
1070
1074
|
}
|
|
1071
1075
|
}
|
|
@@ -1077,17 +1081,17 @@ var Swarm = class {
|
|
|
1077
1081
|
(0, import_log4.log)("offer", {
|
|
1078
1082
|
message
|
|
1079
1083
|
}, {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
+
F: __dxlog_file4,
|
|
1085
|
+
L: 197,
|
|
1086
|
+
S: this,
|
|
1087
|
+
C: (f, a) => f(...a)
|
|
1084
1088
|
});
|
|
1085
1089
|
if (this._ctx.disposed) {
|
|
1086
|
-
(0, import_log4.log)("ignored for disposed swarm",
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1090
|
+
(0, import_log4.log)("ignored for disposed swarm", void 0, {
|
|
1091
|
+
F: __dxlog_file4,
|
|
1092
|
+
L: 199,
|
|
1093
|
+
S: this,
|
|
1094
|
+
C: (f, a) => f(...a)
|
|
1091
1095
|
});
|
|
1092
1096
|
return {
|
|
1093
1097
|
accept: false
|
|
@@ -1098,10 +1102,10 @@ var Swarm = class {
|
|
|
1098
1102
|
(0, import_log4.log)("rejecting offer with incorrect peerId", {
|
|
1099
1103
|
message
|
|
1100
1104
|
}, {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
+
F: __dxlog_file4,
|
|
1106
|
+
L: 206,
|
|
1107
|
+
S: this,
|
|
1108
|
+
C: (f, a) => f(...a)
|
|
1105
1109
|
});
|
|
1106
1110
|
return {
|
|
1107
1111
|
accept: false
|
|
@@ -1111,10 +1115,10 @@ var Swarm = class {
|
|
|
1111
1115
|
(0, import_log4.log)("rejecting offer with incorrect topic", {
|
|
1112
1116
|
message
|
|
1113
1117
|
}, {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
+
F: __dxlog_file4,
|
|
1119
|
+
L: 210,
|
|
1120
|
+
S: this,
|
|
1121
|
+
C: (f, a) => f(...a)
|
|
1118
1122
|
});
|
|
1119
1123
|
return {
|
|
1120
1124
|
accept: false
|
|
@@ -1130,17 +1134,17 @@ var Swarm = class {
|
|
|
1130
1134
|
(0, import_log4.log)("signal", {
|
|
1131
1135
|
message
|
|
1132
1136
|
}, {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
+
F: __dxlog_file4,
|
|
1138
|
+
L: 222,
|
|
1139
|
+
S: this,
|
|
1140
|
+
C: (f, a) => f(...a)
|
|
1137
1141
|
});
|
|
1138
1142
|
if (this._ctx.disposed) {
|
|
1139
|
-
import_log4.log.info("ignored for offline swarm",
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1143
|
+
import_log4.log.info("ignored for offline swarm", void 0, {
|
|
1144
|
+
F: __dxlog_file4,
|
|
1145
|
+
L: 224,
|
|
1146
|
+
S: this,
|
|
1147
|
+
C: (f, a) => f(...a)
|
|
1144
1148
|
});
|
|
1145
1149
|
return;
|
|
1146
1150
|
}
|
|
@@ -1218,10 +1222,10 @@ var Swarm = class {
|
|
|
1218
1222
|
await this._initiateConnection(peer);
|
|
1219
1223
|
} catch (err) {
|
|
1220
1224
|
(0, import_log4.log)("initiation error", err, {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
+
F: __dxlog_file4,
|
|
1226
|
+
L: 327,
|
|
1227
|
+
S: this,
|
|
1228
|
+
C: (f, a) => f(...a)
|
|
1225
1229
|
});
|
|
1226
1230
|
}
|
|
1227
1231
|
});
|
|
@@ -1246,10 +1250,10 @@ var Swarm = class {
|
|
|
1246
1250
|
(0, import_log4.log)("initiation delay", {
|
|
1247
1251
|
remoteId
|
|
1248
1252
|
}, {
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
+
F: __dxlog_file4,
|
|
1254
|
+
L: 354,
|
|
1255
|
+
S: this,
|
|
1256
|
+
C: (f, a) => f(...a)
|
|
1253
1257
|
});
|
|
1254
1258
|
await (0, import_async3.sleep)(INITIATION_DELAY);
|
|
1255
1259
|
}
|
|
@@ -1263,20 +1267,20 @@ var Swarm = class {
|
|
|
1263
1267
|
(0, import_log4.log)("initiating connection...", {
|
|
1264
1268
|
remoteId
|
|
1265
1269
|
}, {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
+
F: __dxlog_file4,
|
|
1271
|
+
L: 368,
|
|
1272
|
+
S: this,
|
|
1273
|
+
C: (f, a) => f(...a)
|
|
1270
1274
|
});
|
|
1271
1275
|
await peer.initiateConnection();
|
|
1272
1276
|
this._topology.update();
|
|
1273
1277
|
(0, import_log4.log)("initiated", {
|
|
1274
1278
|
remoteId
|
|
1275
1279
|
}, {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
+
F: __dxlog_file4,
|
|
1281
|
+
L: 371,
|
|
1282
|
+
S: this,
|
|
1283
|
+
C: (f, a) => f(...a)
|
|
1280
1284
|
});
|
|
1281
1285
|
}
|
|
1282
1286
|
async _closeConnection(peerId) {
|
|
@@ -1287,28 +1291,28 @@ var Swarm = class {
|
|
|
1287
1291
|
await peer.closeConnection();
|
|
1288
1292
|
}
|
|
1289
1293
|
};
|
|
1290
|
-
|
|
1294
|
+
_ts_decorate3([
|
|
1291
1295
|
import_log4.logInfo
|
|
1292
1296
|
], Swarm.prototype, "_instanceId", void 0);
|
|
1293
|
-
|
|
1297
|
+
_ts_decorate3([
|
|
1294
1298
|
import_log4.logInfo
|
|
1295
1299
|
], Swarm.prototype, "ownPeerId", null);
|
|
1296
|
-
|
|
1300
|
+
_ts_decorate3([
|
|
1297
1301
|
import_log4.logInfo
|
|
1298
1302
|
], Swarm.prototype, "topic", null);
|
|
1299
|
-
|
|
1303
|
+
_ts_decorate3([
|
|
1300
1304
|
import_async3.synchronized
|
|
1301
1305
|
], Swarm.prototype, "onSwarmEvent", null);
|
|
1302
|
-
|
|
1306
|
+
_ts_decorate3([
|
|
1303
1307
|
import_async3.synchronized
|
|
1304
1308
|
], Swarm.prototype, "onOffer", null);
|
|
1305
|
-
|
|
1309
|
+
_ts_decorate3([
|
|
1306
1310
|
import_async3.synchronized
|
|
1307
1311
|
], Swarm.prototype, "onSignal", null);
|
|
1308
|
-
|
|
1312
|
+
_ts_decorate3([
|
|
1309
1313
|
import_async3.synchronized
|
|
1310
1314
|
], Swarm.prototype, "goOffline", null);
|
|
1311
|
-
|
|
1315
|
+
_ts_decorate3([
|
|
1312
1316
|
import_async3.synchronized
|
|
1313
1317
|
], Swarm.prototype, "goOnline", null);
|
|
1314
1318
|
|
|
@@ -1317,6 +1321,7 @@ var import_async4 = require("@dxos/async");
|
|
|
1317
1321
|
var import_keys5 = require("@dxos/keys");
|
|
1318
1322
|
var import_log5 = require("@dxos/log");
|
|
1319
1323
|
var import_util3 = require("@dxos/util");
|
|
1324
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm-mapper.ts";
|
|
1320
1325
|
var SwarmMapper = class {
|
|
1321
1326
|
get peers() {
|
|
1322
1327
|
return Array.from(this._peers.values());
|
|
@@ -1343,11 +1348,11 @@ var SwarmMapper = class {
|
|
|
1343
1348
|
this._update();
|
|
1344
1349
|
}
|
|
1345
1350
|
_update() {
|
|
1346
|
-
(0, import_log5.log)("updating swarm",
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
+
(0, import_log5.log)("updating swarm", void 0, {
|
|
1352
|
+
F: __dxlog_file5,
|
|
1353
|
+
L: 75,
|
|
1354
|
+
S: this,
|
|
1355
|
+
C: (f, a) => f(...a)
|
|
1351
1356
|
});
|
|
1352
1357
|
this._peers.clear();
|
|
1353
1358
|
this._peers.set(this._swarm.ownPeerId, {
|
|
@@ -1368,10 +1373,10 @@ var SwarmMapper = class {
|
|
|
1368
1373
|
directConnections: this._swarm.connections.length,
|
|
1369
1374
|
totalPeersInSwarm: this._peers.size
|
|
1370
1375
|
}, {
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1376
|
+
F: __dxlog_file5,
|
|
1377
|
+
L: 116,
|
|
1378
|
+
S: this,
|
|
1379
|
+
C: (f, a) => f(...a)
|
|
1375
1380
|
});
|
|
1376
1381
|
this.mapUpdated.emit(Array.from(this._peers.values()));
|
|
1377
1382
|
}
|
|
@@ -1449,8 +1454,9 @@ var ConnectionLog = class {
|
|
|
1449
1454
|
};
|
|
1450
1455
|
|
|
1451
1456
|
// packages/core/mesh/network-manager/src/network-manager.ts
|
|
1457
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/network-manager.ts";
|
|
1452
1458
|
var NetworkManager = class {
|
|
1453
|
-
constructor({ transportFactory, signalManager, log:
|
|
1459
|
+
constructor({ transportFactory, signalManager, log: log1 }) {
|
|
1454
1460
|
this._swarms = new import_util5.ComplexMap(import_keys7.PublicKey.hash);
|
|
1455
1461
|
this._mappers = new import_util5.ComplexMap(import_keys7.PublicKey.hash);
|
|
1456
1462
|
this._connectionState = import_services.ConnectionState.ONLINE;
|
|
@@ -1470,7 +1476,7 @@ var NetworkManager = class {
|
|
|
1470
1476
|
join: (opts) => this._signalManager.join(opts),
|
|
1471
1477
|
leave: (opts) => this._signalManager.leave(opts)
|
|
1472
1478
|
};
|
|
1473
|
-
if (
|
|
1479
|
+
if (log1) {
|
|
1474
1480
|
this._connectionLog = new ConnectionLog();
|
|
1475
1481
|
}
|
|
1476
1482
|
}
|
|
@@ -1495,30 +1501,30 @@ var NetworkManager = class {
|
|
|
1495
1501
|
import_log6.log.trace("dxos.mesh.network-manager.open", import_protocols4.trace.begin({
|
|
1496
1502
|
id: this._instanceId
|
|
1497
1503
|
}), {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1504
|
+
F: __dxlog_file6,
|
|
1505
|
+
L: 127,
|
|
1506
|
+
S: this,
|
|
1507
|
+
C: (f, a) => f(...a)
|
|
1502
1508
|
});
|
|
1503
1509
|
await this._messenger.open();
|
|
1504
1510
|
await this._signalManager.open();
|
|
1505
1511
|
import_log6.log.trace("dxos.mesh.network-manager.open", import_protocols4.trace.end({
|
|
1506
1512
|
id: this._instanceId
|
|
1507
1513
|
}), {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1514
|
+
F: __dxlog_file6,
|
|
1515
|
+
L: 130,
|
|
1516
|
+
S: this,
|
|
1517
|
+
C: (f, a) => f(...a)
|
|
1512
1518
|
});
|
|
1513
1519
|
}
|
|
1514
1520
|
async close() {
|
|
1515
1521
|
for (const topic of this._swarms.keys()) {
|
|
1516
1522
|
await this.leaveSwarm(topic).catch((err) => {
|
|
1517
|
-
(0, import_log6.log)(err,
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1523
|
+
(0, import_log6.log)(err, void 0, {
|
|
1524
|
+
F: __dxlog_file6,
|
|
1525
|
+
L: 136,
|
|
1526
|
+
S: this,
|
|
1527
|
+
C: (f, a) => f(...a)
|
|
1522
1528
|
});
|
|
1523
1529
|
});
|
|
1524
1530
|
}
|
|
@@ -1542,20 +1548,20 @@ var NetworkManager = class {
|
|
|
1542
1548
|
peerId,
|
|
1543
1549
|
topology: topology.toString()
|
|
1544
1550
|
}, {
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1551
|
+
F: __dxlog_file6,
|
|
1552
|
+
L: 162,
|
|
1553
|
+
S: this,
|
|
1554
|
+
C: (f, a) => f(...a)
|
|
1549
1555
|
});
|
|
1550
1556
|
const swarm = new Swarm(topic, peerId, topology, protocol, this._messenger, this._transportFactory, label);
|
|
1551
1557
|
swarm.errors.handle((error) => {
|
|
1552
1558
|
(0, import_log6.log)("swarm error", {
|
|
1553
1559
|
error
|
|
1554
1560
|
}, {
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1561
|
+
F: __dxlog_file6,
|
|
1562
|
+
L: 165,
|
|
1563
|
+
S: this,
|
|
1564
|
+
C: (f, a) => f(...a)
|
|
1559
1565
|
});
|
|
1560
1566
|
});
|
|
1561
1567
|
this._swarms.set(topic, swarm);
|
|
@@ -1564,11 +1570,11 @@ var NetworkManager = class {
|
|
|
1564
1570
|
this._signalConnection.join({
|
|
1565
1571
|
topic,
|
|
1566
1572
|
peerId
|
|
1567
|
-
}).catch((error) => import_log6.log.catch(error,
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1573
|
+
}).catch((error) => import_log6.log.catch(error, void 0, {
|
|
1574
|
+
F: __dxlog_file6,
|
|
1575
|
+
L: 174,
|
|
1576
|
+
S: this,
|
|
1577
|
+
C: (f, a) => f(...a)
|
|
1572
1578
|
}));
|
|
1573
1579
|
this.topicsUpdated.emit();
|
|
1574
1580
|
(_a2 = this._connectionLog) == null ? void 0 : _a2.joinedSwarm(swarm);
|
|
@@ -1576,10 +1582,10 @@ var NetworkManager = class {
|
|
|
1576
1582
|
topic: import_keys7.PublicKey.from(topic),
|
|
1577
1583
|
count: this._swarms.size
|
|
1578
1584
|
}, {
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1585
|
+
F: __dxlog_file6,
|
|
1586
|
+
L: 178,
|
|
1587
|
+
S: this,
|
|
1588
|
+
C: (f, a) => f(...a)
|
|
1583
1589
|
});
|
|
1584
1590
|
return {
|
|
1585
1591
|
close: () => this.leaveSwarm(topic)
|
|
@@ -1596,10 +1602,10 @@ var NetworkManager = class {
|
|
|
1596
1602
|
(0, import_log6.log)("leaving", {
|
|
1597
1603
|
topic: import_keys7.PublicKey.from(topic)
|
|
1598
1604
|
}, {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1605
|
+
F: __dxlog_file6,
|
|
1606
|
+
L: 194,
|
|
1607
|
+
S: this,
|
|
1608
|
+
C: (f, a) => f(...a)
|
|
1603
1609
|
});
|
|
1604
1610
|
const swarm = this._swarms.get(topic);
|
|
1605
1611
|
await this._signalConnection.leave({
|
|
@@ -1617,10 +1623,10 @@ var NetworkManager = class {
|
|
|
1617
1623
|
topic: import_keys7.PublicKey.from(topic),
|
|
1618
1624
|
count: this._swarms.size
|
|
1619
1625
|
}, {
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1626
|
+
F: __dxlog_file6,
|
|
1627
|
+
L: 208,
|
|
1628
|
+
S: this,
|
|
1629
|
+
C: (f, a) => f(...a)
|
|
1624
1630
|
});
|
|
1625
1631
|
}
|
|
1626
1632
|
async setConnectionState(state) {
|
|
@@ -1692,7 +1698,7 @@ var import_debug4 = require("@dxos/debug");
|
|
|
1692
1698
|
var import_keys8 = require("@dxos/keys");
|
|
1693
1699
|
var import_log9 = require("@dxos/log");
|
|
1694
1700
|
var import_util6 = require("@dxos/util");
|
|
1695
|
-
|
|
1701
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
1696
1702
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1697
1703
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1698
1704
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1701,7 +1707,8 @@ var __decorate4 = function(decorators, target, key, desc) {
|
|
|
1701
1707
|
if (d = decorators[i])
|
|
1702
1708
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1703
1709
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1704
|
-
}
|
|
1710
|
+
}
|
|
1711
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/memory-transport.ts";
|
|
1705
1712
|
var MEMORY_TRANSPORT_DELAY = 1;
|
|
1706
1713
|
var createStreamDelay = (delay) => {
|
|
1707
1714
|
return new import_node_stream.Transform({
|
|
@@ -1721,26 +1728,26 @@ var _MemoryTransport = class {
|
|
|
1721
1728
|
this.closed = new import_async7.Event();
|
|
1722
1729
|
this.connected = new import_async7.Event();
|
|
1723
1730
|
this.errors = new import_debug4.ErrorStream();
|
|
1731
|
+
this._instanceId = import_keys8.PublicKey.random();
|
|
1724
1732
|
this._remote = new import_async7.Trigger();
|
|
1725
1733
|
this._outgoingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
1726
1734
|
this._incomingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
1727
1735
|
this._destroyed = false;
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
callSite: (f, a) => f(...a)
|
|
1736
|
+
(0, import_log9.log)("creating", void 0, {
|
|
1737
|
+
F: __dxlog_file7,
|
|
1738
|
+
L: 64,
|
|
1739
|
+
S: this,
|
|
1740
|
+
C: (f, a) => f(...a)
|
|
1734
1741
|
});
|
|
1735
1742
|
(0, import_tiny_invariant9.default)(!_MemoryTransport._connections.has(this._instanceId), "Duplicate memory connection");
|
|
1736
1743
|
_MemoryTransport._connections.set(this._instanceId, this);
|
|
1737
1744
|
if (this.options.initiator) {
|
|
1738
1745
|
setTimeout(async () => {
|
|
1739
|
-
(0, import_log9.log)("sending signal",
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1746
|
+
(0, import_log9.log)("sending signal", void 0, {
|
|
1747
|
+
F: __dxlog_file7,
|
|
1748
|
+
L: 73,
|
|
1749
|
+
S: this,
|
|
1750
|
+
C: (f, a) => f(...a)
|
|
1744
1751
|
});
|
|
1745
1752
|
void this.options.sendSignal({
|
|
1746
1753
|
payload: {
|
|
@@ -1769,11 +1776,11 @@ var _MemoryTransport = class {
|
|
|
1769
1776
|
(0, import_tiny_invariant9.default)(!this._remoteConnection._remoteConnection, `Remote already connected: ${this._remoteInstanceId}`);
|
|
1770
1777
|
this._remoteConnection._remoteConnection = this;
|
|
1771
1778
|
this._remoteConnection._remoteInstanceId = this._instanceId;
|
|
1772
|
-
(0, import_log9.log)("connected",
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1779
|
+
(0, import_log9.log)("connected", void 0, {
|
|
1780
|
+
F: __dxlog_file7,
|
|
1781
|
+
L: 103,
|
|
1782
|
+
S: this,
|
|
1783
|
+
C: (f, a) => f(...a)
|
|
1777
1784
|
});
|
|
1778
1785
|
this.options.stream.pipe(this._outgoingDelay).pipe(this._remoteConnection.options.stream).pipe(this._incomingDelay).pipe(this.options.stream);
|
|
1779
1786
|
this.connected.emit();
|
|
@@ -1787,20 +1794,20 @@ var _MemoryTransport = class {
|
|
|
1787
1794
|
}
|
|
1788
1795
|
}
|
|
1789
1796
|
async destroy() {
|
|
1790
|
-
(0, import_log9.log)("closing",
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1797
|
+
(0, import_log9.log)("closing", void 0, {
|
|
1798
|
+
F: __dxlog_file7,
|
|
1799
|
+
L: 124,
|
|
1800
|
+
S: this,
|
|
1801
|
+
C: (f, a) => f(...a)
|
|
1795
1802
|
});
|
|
1796
1803
|
this._destroyed = true;
|
|
1797
1804
|
_MemoryTransport._connections.delete(this._instanceId);
|
|
1798
1805
|
if (this._remoteConnection) {
|
|
1799
|
-
(0, import_log9.log)("closing",
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1806
|
+
(0, import_log9.log)("closing", void 0, {
|
|
1807
|
+
F: __dxlog_file7,
|
|
1808
|
+
L: 129,
|
|
1809
|
+
S: this,
|
|
1810
|
+
C: (f, a) => f(...a)
|
|
1804
1811
|
});
|
|
1805
1812
|
this._remoteConnection._destroyed = true;
|
|
1806
1813
|
_MemoryTransport._connections.delete(this._remoteInstanceId);
|
|
@@ -1809,29 +1816,29 @@ var _MemoryTransport = class {
|
|
|
1809
1816
|
this._remoteConnection.closed.emit();
|
|
1810
1817
|
this._remoteConnection._remoteConnection = void 0;
|
|
1811
1818
|
this._remoteConnection = void 0;
|
|
1812
|
-
(0, import_log9.log)("closed",
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1819
|
+
(0, import_log9.log)("closed", void 0, {
|
|
1820
|
+
F: __dxlog_file7,
|
|
1821
|
+
L: 147,
|
|
1822
|
+
S: this,
|
|
1823
|
+
C: (f, a) => f(...a)
|
|
1817
1824
|
});
|
|
1818
1825
|
}
|
|
1819
1826
|
this.closed.emit();
|
|
1820
|
-
(0, import_log9.log)("closed",
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1827
|
+
(0, import_log9.log)("closed", void 0, {
|
|
1828
|
+
F: __dxlog_file7,
|
|
1829
|
+
L: 151,
|
|
1830
|
+
S: this,
|
|
1831
|
+
C: (f, a) => f(...a)
|
|
1825
1832
|
});
|
|
1826
1833
|
}
|
|
1827
1834
|
signal({ payload }) {
|
|
1828
1835
|
(0, import_log9.log)("received signal", {
|
|
1829
1836
|
payload
|
|
1830
1837
|
}, {
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1838
|
+
F: __dxlog_file7,
|
|
1839
|
+
L: 155,
|
|
1840
|
+
S: this,
|
|
1841
|
+
C: (f, a) => f(...a)
|
|
1835
1842
|
});
|
|
1836
1843
|
if (!(payload == null ? void 0 : payload.transportId)) {
|
|
1837
1844
|
return;
|
|
@@ -1846,10 +1853,10 @@ var _MemoryTransport = class {
|
|
|
1846
1853
|
var MemoryTransport = _MemoryTransport;
|
|
1847
1854
|
// TODO(burdon): Remove static properties (inject context into constructor).
|
|
1848
1855
|
MemoryTransport._connections = new import_util6.ComplexMap(import_keys8.PublicKey.hash);
|
|
1849
|
-
|
|
1856
|
+
_ts_decorate4([
|
|
1850
1857
|
import_log9.logInfo
|
|
1851
1858
|
], MemoryTransport.prototype, "_instanceId", void 0);
|
|
1852
|
-
|
|
1859
|
+
_ts_decorate4([
|
|
1853
1860
|
import_log9.logInfo
|
|
1854
1861
|
], MemoryTransport.prototype, "_remoteInstanceId", void 0);
|
|
1855
1862
|
|
|
@@ -1870,6 +1877,7 @@ try {
|
|
|
1870
1877
|
}
|
|
1871
1878
|
|
|
1872
1879
|
// packages/core/mesh/network-manager/src/transport/webrtc-transport.ts
|
|
1880
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport.ts";
|
|
1873
1881
|
var WebRTCTransport = class {
|
|
1874
1882
|
constructor(params) {
|
|
1875
1883
|
var _a2;
|
|
@@ -1882,16 +1890,16 @@ var WebRTCTransport = class {
|
|
|
1882
1890
|
import_log10.log.trace("dxos.mesh.webrtc-transport.constructor", import_protocols5.trace.begin({
|
|
1883
1891
|
id: this._instanceId
|
|
1884
1892
|
}), {
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1893
|
+
F: __dxlog_file8,
|
|
1894
|
+
L: 39,
|
|
1895
|
+
S: this,
|
|
1896
|
+
C: (f, a) => f(...a)
|
|
1889
1897
|
});
|
|
1890
1898
|
(0, import_log10.log)("created connection", params, {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1899
|
+
F: __dxlog_file8,
|
|
1900
|
+
L: 40,
|
|
1901
|
+
S: this,
|
|
1902
|
+
C: (f, a) => f(...a)
|
|
1895
1903
|
});
|
|
1896
1904
|
this._peer = new import_simple_peer.default({
|
|
1897
1905
|
initiator: this.params.initiator,
|
|
@@ -1900,10 +1908,10 @@ var WebRTCTransport = class {
|
|
|
1900
1908
|
});
|
|
1901
1909
|
this._peer.on("signal", async (data) => {
|
|
1902
1910
|
(0, import_log10.log)("signal", data, {
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1911
|
+
F: __dxlog_file8,
|
|
1912
|
+
L: 48,
|
|
1913
|
+
S: this,
|
|
1914
|
+
C: (f, a) => f(...a)
|
|
1907
1915
|
});
|
|
1908
1916
|
await this.params.sendSignal({
|
|
1909
1917
|
payload: {
|
|
@@ -1912,21 +1920,21 @@ var WebRTCTransport = class {
|
|
|
1912
1920
|
});
|
|
1913
1921
|
});
|
|
1914
1922
|
this._peer.on("connect", () => {
|
|
1915
|
-
(0, import_log10.log)("connected",
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1923
|
+
(0, import_log10.log)("connected", void 0, {
|
|
1924
|
+
F: __dxlog_file8,
|
|
1925
|
+
L: 53,
|
|
1926
|
+
S: this,
|
|
1927
|
+
C: (f, a) => f(...a)
|
|
1920
1928
|
});
|
|
1921
1929
|
this.params.stream.pipe(this._peer).pipe(this.params.stream);
|
|
1922
1930
|
this.connected.emit();
|
|
1923
1931
|
});
|
|
1924
1932
|
this._peer.on("close", async () => {
|
|
1925
|
-
(0, import_log10.log)("closed",
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1933
|
+
(0, import_log10.log)("closed", void 0, {
|
|
1934
|
+
F: __dxlog_file8,
|
|
1935
|
+
L: 59,
|
|
1936
|
+
S: this,
|
|
1937
|
+
C: (f, a) => f(...a)
|
|
1930
1938
|
});
|
|
1931
1939
|
await this._disconnectStreams();
|
|
1932
1940
|
this.closed.emit();
|
|
@@ -1941,10 +1949,10 @@ var WebRTCTransport = class {
|
|
|
1941
1949
|
config: this.params.webrtcConfig,
|
|
1942
1950
|
stats
|
|
1943
1951
|
}, {
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1952
|
+
F: __dxlog_file8,
|
|
1953
|
+
L: 71,
|
|
1954
|
+
S: this,
|
|
1955
|
+
C: (f, a) => f(...a)
|
|
1948
1956
|
});
|
|
1949
1957
|
});
|
|
1950
1958
|
}
|
|
@@ -1955,28 +1963,28 @@ var WebRTCTransport = class {
|
|
|
1955
1963
|
import_log10.log.trace("dxos.mesh.webrtc-transport.constructor", import_protocols5.trace.end({
|
|
1956
1964
|
id: this._instanceId
|
|
1957
1965
|
}), {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1966
|
+
F: __dxlog_file8,
|
|
1967
|
+
L: 81,
|
|
1968
|
+
S: this,
|
|
1969
|
+
C: (f, a) => f(...a)
|
|
1962
1970
|
});
|
|
1963
1971
|
}
|
|
1964
1972
|
async destroy() {
|
|
1965
|
-
(0, import_log10.log)("closing...",
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1973
|
+
(0, import_log10.log)("closing...", void 0, {
|
|
1974
|
+
F: __dxlog_file8,
|
|
1975
|
+
L: 85,
|
|
1976
|
+
S: this,
|
|
1977
|
+
C: (f, a) => f(...a)
|
|
1970
1978
|
});
|
|
1971
1979
|
this._closed = true;
|
|
1972
1980
|
await this._disconnectStreams();
|
|
1973
1981
|
this._peer.destroy();
|
|
1974
1982
|
this.closed.emit();
|
|
1975
|
-
(0, import_log10.log)("closed",
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1983
|
+
(0, import_log10.log)("closed", void 0, {
|
|
1984
|
+
F: __dxlog_file8,
|
|
1985
|
+
L: 90,
|
|
1986
|
+
S: this,
|
|
1987
|
+
C: (f, a) => f(...a)
|
|
1980
1988
|
});
|
|
1981
1989
|
}
|
|
1982
1990
|
signal(signal) {
|
|
@@ -2000,6 +2008,7 @@ var import_keys10 = require("@dxos/keys");
|
|
|
2000
2008
|
var import_log11 = require("@dxos/log");
|
|
2001
2009
|
var import_bridge = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
2002
2010
|
var import_util7 = require("@dxos/util");
|
|
2011
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport-service.ts";
|
|
2003
2012
|
var WebRTCTransportService = class {
|
|
2004
2013
|
// prettier-ignore
|
|
2005
2014
|
constructor(_webrtcConfig) {
|
|
@@ -2082,11 +2091,11 @@ var WebRTCTransportService = class {
|
|
|
2082
2091
|
await ((_a2 = this.transports.get(proxyId)) == null ? void 0 : _a2.transport.destroy());
|
|
2083
2092
|
await ((_b = this.transports.get(proxyId)) == null ? void 0 : _b.stream.end());
|
|
2084
2093
|
this.transports.delete(proxyId);
|
|
2085
|
-
(0, import_log11.log)("Closed.",
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2094
|
+
(0, import_log11.log)("Closed.", void 0, {
|
|
2095
|
+
F: __dxlog_file9,
|
|
2096
|
+
L: 109,
|
|
2097
|
+
S: this,
|
|
2098
|
+
C: (f, a) => f(...a)
|
|
2090
2099
|
});
|
|
2091
2100
|
}
|
|
2092
2101
|
};
|
|
@@ -2100,6 +2109,7 @@ var import_keys11 = require("@dxos/keys");
|
|
|
2100
2109
|
var import_log12 = require("@dxos/log");
|
|
2101
2110
|
var import_bridge2 = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
2102
2111
|
var import_util8 = require("@dxos/util");
|
|
2112
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport-proxy.ts";
|
|
2103
2113
|
var WebRTCTransportProxy = class {
|
|
2104
2114
|
// prettier-ignore
|
|
2105
2115
|
constructor(_params) {
|
|
@@ -2117,10 +2127,10 @@ var WebRTCTransportProxy = class {
|
|
|
2117
2127
|
this._serviceStream.waitUntilReady().then(() => {
|
|
2118
2128
|
this._serviceStream.subscribe(async (event) => {
|
|
2119
2129
|
(0, import_log12.log)("WebRTCTransportProxy: event", event, {
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2130
|
+
F: __dxlog_file10,
|
|
2131
|
+
L: 50,
|
|
2132
|
+
S: this,
|
|
2133
|
+
C: (f, a) => f(...a)
|
|
2124
2134
|
});
|
|
2125
2135
|
if (event.connection) {
|
|
2126
2136
|
await this._handleConnection(event.connection);
|
|
@@ -2137,11 +2147,11 @@ var WebRTCTransportProxy = class {
|
|
|
2137
2147
|
payload: data
|
|
2138
2148
|
});
|
|
2139
2149
|
} catch (err) {
|
|
2140
|
-
import_log12.log.catch(err,
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2150
|
+
import_log12.log.catch(err, void 0, {
|
|
2151
|
+
F: __dxlog_file10,
|
|
2152
|
+
L: 67,
|
|
2153
|
+
S: this,
|
|
2154
|
+
C: (f, a) => f(...a)
|
|
2145
2155
|
});
|
|
2146
2156
|
}
|
|
2147
2157
|
};
|
|
@@ -2149,11 +2159,11 @@ var WebRTCTransportProxy = class {
|
|
|
2149
2159
|
this._ctx.onDispose(() => {
|
|
2150
2160
|
this._params.stream.off("data", dataListener);
|
|
2151
2161
|
});
|
|
2152
|
-
}, (error) => import_log12.log.catch(error,
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2162
|
+
}, (error) => import_log12.log.catch(error, void 0, {
|
|
2163
|
+
F: __dxlog_file10,
|
|
2164
|
+
L: 73,
|
|
2165
|
+
S: this,
|
|
2166
|
+
C: (f, a) => f(...a)
|
|
2157
2167
|
}));
|
|
2158
2168
|
}
|
|
2159
2169
|
async _handleConnection(connectionEvent) {
|
|
@@ -2195,11 +2205,11 @@ var WebRTCTransportProxy = class {
|
|
|
2195
2205
|
proxyId: this._proxyId
|
|
2196
2206
|
});
|
|
2197
2207
|
} catch (err) {
|
|
2198
|
-
import_log12.log.catch(err,
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2208
|
+
import_log12.log.catch(err, void 0, {
|
|
2209
|
+
F: __dxlog_file10,
|
|
2210
|
+
L: 124,
|
|
2211
|
+
S: this,
|
|
2212
|
+
C: (f, a) => f(...a)
|
|
2203
2213
|
});
|
|
2204
2214
|
}
|
|
2205
2215
|
this.closed.emit();
|
|
@@ -2268,6 +2278,7 @@ var createTeleportProtocolFactory = (onConnection) => {
|
|
|
2268
2278
|
};
|
|
2269
2279
|
|
|
2270
2280
|
// packages/core/mesh/network-manager/src/testing/test-wire-protocol.ts
|
|
2281
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/testing/test-wire-protocol.ts";
|
|
2271
2282
|
var TestWireProtocol = class {
|
|
2272
2283
|
constructor(peerId) {
|
|
2273
2284
|
this.peerId = peerId;
|
|
@@ -2278,10 +2289,10 @@ var TestWireProtocol = class {
|
|
|
2278
2289
|
(0, import_log13.log)("create", {
|
|
2279
2290
|
remotePeerId: teleport.remotePeerId
|
|
2280
2291
|
}, {
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2292
|
+
F: __dxlog_file11,
|
|
2293
|
+
L: 21,
|
|
2294
|
+
S: this,
|
|
2295
|
+
C: (f, a) => f(...a)
|
|
2285
2296
|
});
|
|
2286
2297
|
const extension = new import_teleport2.TestExtension({
|
|
2287
2298
|
onClose: async () => {
|
|
@@ -2301,10 +2312,10 @@ var TestWireProtocol = class {
|
|
|
2301
2312
|
(0, import_log13.log)("waitForConnection", {
|
|
2302
2313
|
peerId
|
|
2303
2314
|
}, {
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2315
|
+
F: __dxlog_file11,
|
|
2316
|
+
L: 37,
|
|
2317
|
+
S: this,
|
|
2318
|
+
C: (f, a) => f(...a)
|
|
2308
2319
|
});
|
|
2309
2320
|
await (0, import_async10.asyncTimeout)(
|
|
2310
2321
|
this.connected.waitFor((connectedId) => connectedId.equals(peerId)),
|