@dxos/network-manager 0.1.58-main.09c7b08 → 0.1.58-main.0b23736
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-26KK6XOP.mjs → chunk-2CI23U3F.mjs} +43 -53
- package/dist/lib/browser/chunk-2CI23U3F.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +140 -10
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node/index.cjs +42 -186
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +42 -52
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/swarm/connection.d.ts.map +1 -1
- package/dist/types/src/swarm/peer.d.ts.map +1 -1
- package/dist/types/src/transport/index.d.ts +0 -1
- package/dist/types/src/transport/index.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport.d.ts.map +1 -1
- package/package.json +17 -18
- package/src/swarm/connection.ts +3 -4
- package/src/swarm/peer.ts +0 -1
- package/src/transport/index.ts +0 -1
- package/src/transport/simplepeer-transport.ts +0 -5
- package/dist/lib/browser/chunk-26KK6XOP.mjs.map +0 -7
|
@@ -197,7 +197,7 @@ var Connection = class {
|
|
|
197
197
|
this.closeReason = err?.message;
|
|
198
198
|
}
|
|
199
199
|
if (err instanceof ConnectionResetError) {
|
|
200
|
-
log
|
|
200
|
+
log("aborting due to transport ConnectionResetError", void 0, {
|
|
201
201
|
F: __dxlog_file,
|
|
202
202
|
L: 197,
|
|
203
203
|
S: this,
|
|
@@ -205,7 +205,7 @@ var Connection = class {
|
|
|
205
205
|
});
|
|
206
206
|
this.abort().catch((err2) => this.errors.raise(err2));
|
|
207
207
|
} else if (err instanceof ConnectivityError) {
|
|
208
|
-
log
|
|
208
|
+
log("aborting due to transport ConnectivityError", void 0, {
|
|
209
209
|
F: __dxlog_file,
|
|
210
210
|
L: 200,
|
|
211
211
|
S: this,
|
|
@@ -213,7 +213,7 @@ var Connection = class {
|
|
|
213
213
|
});
|
|
214
214
|
this.abort().catch((err2) => this.errors.raise(err2));
|
|
215
215
|
} else if (err instanceof UnknownProtocolError) {
|
|
216
|
-
log
|
|
216
|
+
log("unsure what to do for UnknownProtocolError", {
|
|
217
217
|
err
|
|
218
218
|
}, {
|
|
219
219
|
F: __dxlog_file,
|
|
@@ -244,14 +244,14 @@ var Connection = class {
|
|
|
244
244
|
err
|
|
245
245
|
}, {
|
|
246
246
|
F: __dxlog_file,
|
|
247
|
-
L:
|
|
247
|
+
L: 224,
|
|
248
248
|
S: this,
|
|
249
249
|
C: (f, a) => f(...a)
|
|
250
250
|
});
|
|
251
251
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTED) {
|
|
252
252
|
log(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
253
253
|
F: __dxlog_file,
|
|
254
|
-
L:
|
|
254
|
+
L: 226,
|
|
255
255
|
S: this,
|
|
256
256
|
C: (f, a) => f(...a)
|
|
257
257
|
});
|
|
@@ -267,7 +267,7 @@ var Connection = class {
|
|
|
267
267
|
proto: this._protocol
|
|
268
268
|
}, {
|
|
269
269
|
F: __dxlog_file,
|
|
270
|
-
L:
|
|
270
|
+
L: 239,
|
|
271
271
|
S: this,
|
|
272
272
|
C: (f, a) => f(...a)
|
|
273
273
|
});
|
|
@@ -275,7 +275,7 @@ var Connection = class {
|
|
|
275
275
|
} catch (err2) {
|
|
276
276
|
log.catch(err2, void 0, {
|
|
277
277
|
F: __dxlog_file,
|
|
278
|
-
L:
|
|
278
|
+
L: 242,
|
|
279
279
|
S: this,
|
|
280
280
|
C: (f, a) => f(...a)
|
|
281
281
|
});
|
|
@@ -285,7 +285,7 @@ var Connection = class {
|
|
|
285
285
|
} catch (err2) {
|
|
286
286
|
log.catch(err2, void 0, {
|
|
287
287
|
F: __dxlog_file,
|
|
288
|
-
L:
|
|
288
|
+
L: 249,
|
|
289
289
|
S: this,
|
|
290
290
|
C: (f, a) => f(...a)
|
|
291
291
|
});
|
|
@@ -295,7 +295,7 @@ var Connection = class {
|
|
|
295
295
|
} catch (err2) {
|
|
296
296
|
log.catch(err2, void 0, {
|
|
297
297
|
F: __dxlog_file,
|
|
298
|
-
L:
|
|
298
|
+
L: 255,
|
|
299
299
|
S: this,
|
|
300
300
|
C: (f, a) => f(...a)
|
|
301
301
|
});
|
|
@@ -316,7 +316,7 @@ var Connection = class {
|
|
|
316
316
|
peerId: this.ownId
|
|
317
317
|
}, {
|
|
318
318
|
F: __dxlog_file,
|
|
319
|
-
L:
|
|
319
|
+
L: 277,
|
|
320
320
|
S: this,
|
|
321
321
|
C: (f, a) => f(...a)
|
|
322
322
|
});
|
|
@@ -326,7 +326,7 @@ var Connection = class {
|
|
|
326
326
|
} catch (err2) {
|
|
327
327
|
log.catch(err2, void 0, {
|
|
328
328
|
F: __dxlog_file,
|
|
329
|
-
L:
|
|
329
|
+
L: 284,
|
|
330
330
|
S: this,
|
|
331
331
|
C: (f, a) => f(...a)
|
|
332
332
|
});
|
|
@@ -336,7 +336,7 @@ var Connection = class {
|
|
|
336
336
|
} catch (err2) {
|
|
337
337
|
log.catch(err2, void 0, {
|
|
338
338
|
F: __dxlog_file,
|
|
339
|
-
L:
|
|
339
|
+
L: 291,
|
|
340
340
|
S: this,
|
|
341
341
|
C: (f, a) => f(...a)
|
|
342
342
|
});
|
|
@@ -346,7 +346,7 @@ var Connection = class {
|
|
|
346
346
|
peerId: this.ownId
|
|
347
347
|
}, {
|
|
348
348
|
F: __dxlog_file,
|
|
349
|
-
L:
|
|
349
|
+
L: 295,
|
|
350
350
|
S: this,
|
|
351
351
|
C: (f, a) => f(...a)
|
|
352
352
|
});
|
|
@@ -389,7 +389,7 @@ var Connection = class {
|
|
|
389
389
|
err
|
|
390
390
|
}, {
|
|
391
391
|
F: __dxlog_file,
|
|
392
|
-
L:
|
|
392
|
+
L: 332,
|
|
393
393
|
S: this,
|
|
394
394
|
C: (f, a) => f(...a)
|
|
395
395
|
});
|
|
@@ -402,7 +402,7 @@ var Connection = class {
|
|
|
402
402
|
async signal(msg) {
|
|
403
403
|
invariant(msg.sessionId, void 0, {
|
|
404
404
|
F: __dxlog_file,
|
|
405
|
-
L:
|
|
405
|
+
L: 341,
|
|
406
406
|
S: this,
|
|
407
407
|
A: [
|
|
408
408
|
"msg.sessionId",
|
|
@@ -412,7 +412,7 @@ var Connection = class {
|
|
|
412
412
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
413
413
|
log("dropping signal for incorrect session id", void 0, {
|
|
414
414
|
F: __dxlog_file,
|
|
415
|
-
L:
|
|
415
|
+
L: 343,
|
|
416
416
|
S: this,
|
|
417
417
|
C: (f, a) => f(...a)
|
|
418
418
|
});
|
|
@@ -420,7 +420,7 @@ var Connection = class {
|
|
|
420
420
|
}
|
|
421
421
|
invariant(msg.data.signal || msg.data.signalBatch, void 0, {
|
|
422
422
|
F: __dxlog_file,
|
|
423
|
-
L:
|
|
423
|
+
L: 346,
|
|
424
424
|
S: this,
|
|
425
425
|
A: [
|
|
426
426
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -429,7 +429,7 @@ var Connection = class {
|
|
|
429
429
|
});
|
|
430
430
|
invariant(msg.author?.equals(this.remoteId), void 0, {
|
|
431
431
|
F: __dxlog_file,
|
|
432
|
-
L:
|
|
432
|
+
L: 347,
|
|
433
433
|
S: this,
|
|
434
434
|
A: [
|
|
435
435
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -438,7 +438,7 @@ var Connection = class {
|
|
|
438
438
|
});
|
|
439
439
|
invariant(msg.recipient?.equals(this.ownId), void 0, {
|
|
440
440
|
F: __dxlog_file,
|
|
441
|
-
L:
|
|
441
|
+
L: 348,
|
|
442
442
|
S: this,
|
|
443
443
|
A: [
|
|
444
444
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -462,7 +462,7 @@ var Connection = class {
|
|
|
462
462
|
msg: msg.data
|
|
463
463
|
}, {
|
|
464
464
|
F: __dxlog_file,
|
|
465
|
-
L:
|
|
465
|
+
L: 357,
|
|
466
466
|
S: this,
|
|
467
467
|
C: (f, a) => f(...a)
|
|
468
468
|
});
|
|
@@ -470,7 +470,7 @@ var Connection = class {
|
|
|
470
470
|
} else {
|
|
471
471
|
invariant(this._transport, "Connection not ready to accept signals.", {
|
|
472
472
|
F: __dxlog_file,
|
|
473
|
-
L:
|
|
473
|
+
L: 360,
|
|
474
474
|
S: this,
|
|
475
475
|
A: [
|
|
476
476
|
"this._transport",
|
|
@@ -483,7 +483,7 @@ var Connection = class {
|
|
|
483
483
|
msg: msg.data
|
|
484
484
|
}, {
|
|
485
485
|
F: __dxlog_file,
|
|
486
|
-
L:
|
|
486
|
+
L: 361,
|
|
487
487
|
S: this,
|
|
488
488
|
C: (f, a) => f(...a)
|
|
489
489
|
});
|
|
@@ -501,13 +501,13 @@ var Connection = class {
|
|
|
501
501
|
peerId: this.ownId
|
|
502
502
|
}, {
|
|
503
503
|
F: __dxlog_file,
|
|
504
|
-
L:
|
|
504
|
+
L: 372,
|
|
505
505
|
S: this,
|
|
506
506
|
C: (f, a) => f(...a)
|
|
507
507
|
});
|
|
508
508
|
invariant(state !== this._state, "Already in this state.", {
|
|
509
509
|
F: __dxlog_file,
|
|
510
|
-
L:
|
|
510
|
+
L: 373,
|
|
511
511
|
S: this,
|
|
512
512
|
A: [
|
|
513
513
|
"state !== this._state",
|
|
@@ -978,12 +978,6 @@ var Peer = class {
|
|
|
978
978
|
C: (f, a) => f(...a)
|
|
979
979
|
});
|
|
980
980
|
if (err instanceof TimeoutError) {
|
|
981
|
-
log3.warn("aborting connection due to signalling failure", void 0, {
|
|
982
|
-
F: __dxlog_file3,
|
|
983
|
-
L: 202,
|
|
984
|
-
S: this,
|
|
985
|
-
C: (f, a) => f(...a)
|
|
986
|
-
});
|
|
987
981
|
await connection.abort(err);
|
|
988
982
|
}
|
|
989
983
|
await this.closeConnection(err);
|
|
@@ -1005,13 +999,13 @@ var Peer = class {
|
|
|
1005
999
|
sessionId
|
|
1006
1000
|
}, {
|
|
1007
1001
|
F: __dxlog_file3,
|
|
1008
|
-
L:
|
|
1002
|
+
L: 217,
|
|
1009
1003
|
S: this,
|
|
1010
1004
|
C: (f, a) => f(...a)
|
|
1011
1005
|
});
|
|
1012
1006
|
invariant3(!this.connection, "Already connected.", {
|
|
1013
1007
|
F: __dxlog_file3,
|
|
1014
|
-
L:
|
|
1008
|
+
L: 224,
|
|
1015
1009
|
S: this,
|
|
1016
1010
|
A: [
|
|
1017
1011
|
"!this.connection",
|
|
@@ -1047,7 +1041,7 @@ var Peer = class {
|
|
|
1047
1041
|
initiator
|
|
1048
1042
|
}, {
|
|
1049
1043
|
F: __dxlog_file3,
|
|
1050
|
-
L:
|
|
1044
|
+
L: 243,
|
|
1051
1045
|
S: this,
|
|
1052
1046
|
C: (f, a) => f(...a)
|
|
1053
1047
|
});
|
|
@@ -1060,14 +1054,14 @@ var Peer = class {
|
|
|
1060
1054
|
initiator
|
|
1061
1055
|
}, {
|
|
1062
1056
|
F: __dxlog_file3,
|
|
1063
|
-
L:
|
|
1057
|
+
L: 252,
|
|
1064
1058
|
S: this,
|
|
1065
1059
|
C: (f, a) => f(...a)
|
|
1066
1060
|
});
|
|
1067
1061
|
this._connectionLimiter.doneConnecting(sessionId);
|
|
1068
1062
|
invariant3(this.connection === connection, "Connection mismatch (race condition).", {
|
|
1069
1063
|
F: __dxlog_file3,
|
|
1070
|
-
L:
|
|
1064
|
+
L: 257,
|
|
1071
1065
|
S: this,
|
|
1072
1066
|
A: [
|
|
1073
1067
|
"this.connection === connection",
|
|
@@ -1082,7 +1076,7 @@ var Peer = class {
|
|
|
1082
1076
|
initiator
|
|
1083
1077
|
}, {
|
|
1084
1078
|
F: __dxlog_file3,
|
|
1085
|
-
L:
|
|
1079
|
+
L: 259,
|
|
1086
1080
|
S: this,
|
|
1087
1081
|
C: (f, a) => f(...a)
|
|
1088
1082
|
});
|
|
@@ -1117,7 +1111,7 @@ var Peer = class {
|
|
|
1117
1111
|
err
|
|
1118
1112
|
}, {
|
|
1119
1113
|
F: __dxlog_file3,
|
|
1120
|
-
L:
|
|
1114
|
+
L: 299,
|
|
1121
1115
|
S: this,
|
|
1122
1116
|
C: (f, a) => f(...a)
|
|
1123
1117
|
});
|
|
@@ -1130,7 +1124,7 @@ var Peer = class {
|
|
|
1130
1124
|
err
|
|
1131
1125
|
}, {
|
|
1132
1126
|
F: __dxlog_file3,
|
|
1133
|
-
L:
|
|
1127
|
+
L: 300,
|
|
1134
1128
|
S: this,
|
|
1135
1129
|
C: (f, a) => f(...a)
|
|
1136
1130
|
});
|
|
@@ -1149,7 +1143,7 @@ var Peer = class {
|
|
|
1149
1143
|
sessionId: connection.sessionId
|
|
1150
1144
|
}, {
|
|
1151
1145
|
F: __dxlog_file3,
|
|
1152
|
-
L:
|
|
1146
|
+
L: 325,
|
|
1153
1147
|
S: this,
|
|
1154
1148
|
C: (f, a) => f(...a)
|
|
1155
1149
|
});
|
|
@@ -1159,7 +1153,7 @@ var Peer = class {
|
|
|
1159
1153
|
sessionId: connection.sessionId
|
|
1160
1154
|
}, {
|
|
1161
1155
|
F: __dxlog_file3,
|
|
1162
|
-
L:
|
|
1156
|
+
L: 331,
|
|
1163
1157
|
S: this,
|
|
1164
1158
|
C: (f, a) => f(...a)
|
|
1165
1159
|
});
|
|
@@ -1170,7 +1164,7 @@ var Peer = class {
|
|
|
1170
1164
|
message
|
|
1171
1165
|
}, {
|
|
1172
1166
|
F: __dxlog_file3,
|
|
1173
|
-
L:
|
|
1167
|
+
L: 336,
|
|
1174
1168
|
S: this,
|
|
1175
1169
|
C: (f, a) => f(...a)
|
|
1176
1170
|
});
|
|
@@ -1185,7 +1179,7 @@ var Peer = class {
|
|
|
1185
1179
|
topic: this.topic
|
|
1186
1180
|
}, {
|
|
1187
1181
|
F: __dxlog_file3,
|
|
1188
|
-
L:
|
|
1182
|
+
L: 346,
|
|
1189
1183
|
S: this,
|
|
1190
1184
|
C: (f, a) => f(...a)
|
|
1191
1185
|
});
|
|
@@ -2691,28 +2685,24 @@ var SimplePeerTransport = class {
|
|
|
2691
2685
|
switch (err.code) {
|
|
2692
2686
|
case "ERR_WEBRTC_SUPPORT":
|
|
2693
2687
|
this.errors.raise(new ProtocolError2("WebRTC not supported", err));
|
|
2694
|
-
break;
|
|
2695
2688
|
case "ERR_ICE_CONNECTION_FAILURE":
|
|
2696
2689
|
case "ERR_DATA_CHANNEL":
|
|
2697
2690
|
case "ERR_CONNECTION_FAILURE":
|
|
2698
2691
|
case "ERR_SIGNALING":
|
|
2699
2692
|
this.errors.raise(new ConnectivityError2("unknown communication failure", err));
|
|
2700
|
-
break;
|
|
2701
2693
|
case "ERR_CREATE_OFFER":
|
|
2702
2694
|
case "ERR_CREATE_ANSWER":
|
|
2703
2695
|
case "ERR_SET_LOCAL_DESCRIPTION":
|
|
2704
2696
|
case "ERR_SET_REMOTE_DESCRIPTION":
|
|
2705
2697
|
case "ERR_ADD_ICE_CANDIDATE":
|
|
2706
2698
|
this.errors.raise(new UnknownProtocolError2("unknown simple-peer library failure", err));
|
|
2707
|
-
break;
|
|
2708
2699
|
default:
|
|
2709
2700
|
this.errors.raise(new Error("unknown simple-peer error"));
|
|
2710
|
-
break;
|
|
2711
2701
|
}
|
|
2712
2702
|
} else {
|
|
2713
2703
|
log11.info("unknown peer connection error", err, {
|
|
2714
2704
|
F: __dxlog_file12,
|
|
2715
|
-
L:
|
|
2705
|
+
L: 96,
|
|
2716
2706
|
S: this,
|
|
2717
2707
|
C: (f, a) => f(...a)
|
|
2718
2708
|
});
|
|
@@ -2726,7 +2716,7 @@ var SimplePeerTransport = class {
|
|
|
2726
2716
|
stats
|
|
2727
2717
|
}, {
|
|
2728
2718
|
F: __dxlog_file12,
|
|
2729
|
-
L:
|
|
2719
|
+
L: 104,
|
|
2730
2720
|
S: this,
|
|
2731
2721
|
C: (f, a) => f(...a)
|
|
2732
2722
|
});
|
|
@@ -2735,7 +2725,7 @@ var SimplePeerTransport = class {
|
|
|
2735
2725
|
} catch (err2) {
|
|
2736
2726
|
log11.catch(err2, void 0, {
|
|
2737
2727
|
F: __dxlog_file12,
|
|
2738
|
-
L:
|
|
2728
|
+
L: 111,
|
|
2739
2729
|
S: this,
|
|
2740
2730
|
C: (f, a) => f(...a)
|
|
2741
2731
|
});
|
|
@@ -2746,7 +2736,7 @@ var SimplePeerTransport = class {
|
|
|
2746
2736
|
id: this._instanceId
|
|
2747
2737
|
}), {
|
|
2748
2738
|
F: __dxlog_file12,
|
|
2749
|
-
L:
|
|
2739
|
+
L: 116,
|
|
2750
2740
|
S: this,
|
|
2751
2741
|
C: (f, a) => f(...a)
|
|
2752
2742
|
});
|
|
@@ -2754,7 +2744,7 @@ var SimplePeerTransport = class {
|
|
|
2754
2744
|
async destroy() {
|
|
2755
2745
|
log11("closing...", void 0, {
|
|
2756
2746
|
F: __dxlog_file12,
|
|
2757
|
-
L:
|
|
2747
|
+
L: 120,
|
|
2758
2748
|
S: this,
|
|
2759
2749
|
C: (f, a) => f(...a)
|
|
2760
2750
|
});
|
|
@@ -2764,7 +2754,7 @@ var SimplePeerTransport = class {
|
|
|
2764
2754
|
this.closed.emit();
|
|
2765
2755
|
log11("closed", void 0, {
|
|
2766
2756
|
F: __dxlog_file12,
|
|
2767
|
-
L:
|
|
2757
|
+
L: 125,
|
|
2768
2758
|
S: this,
|
|
2769
2759
|
C: (f, a) => f(...a)
|
|
2770
2760
|
});
|
|
@@ -3486,4 +3476,4 @@ export {
|
|
|
3486
3476
|
createLibDataChannelTransportFactory,
|
|
3487
3477
|
createTeleportProtocolFactory
|
|
3488
3478
|
};
|
|
3489
|
-
//# sourceMappingURL=chunk-
|
|
3479
|
+
//# sourceMappingURL=chunk-2CI23U3F.mjs.map
|