@dxos/network-manager 0.3.0 → 0.3.1-main.2d5b138
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-LN6AHVN6.mjs → chunk-UE5KR5PC.mjs} +198 -123
- package/dist/lib/browser/chunk-UE5KR5PC.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 +3 -3
- package/dist/lib/node/index.cjs +189 -114
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +189 -114
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/swarm/connection.d.ts +1 -0
- package/dist/types/src/swarm/connection.d.ts.map +1 -1
- package/dist/types/src/swarm/peer.d.ts +1 -1
- package/dist/types/src/swarm/peer.d.ts.map +1 -1
- package/dist/types/src/swarm/swarm.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/swarm/connection.ts +27 -5
- package/src/swarm/peer.ts +47 -11
- package/src/swarm/swarm.ts +10 -7
- package/dist/lib/browser/chunk-LN6AHVN6.mjs.map +0 -7
|
@@ -549,7 +549,7 @@ var createTeleportProtocolFactory = (onConnection) => {
|
|
|
549
549
|
};
|
|
550
550
|
|
|
551
551
|
// packages/core/mesh/network-manager/src/testing/test-wire-protocol.ts
|
|
552
|
-
var __dxlog_file = "/
|
|
552
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/testing/test-wire-protocol.ts";
|
|
553
553
|
var TestWireProtocol = class {
|
|
554
554
|
constructor(peerId, _extensionFactory = () => []) {
|
|
555
555
|
this.peerId = peerId;
|
|
@@ -666,8 +666,9 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
666
666
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
667
667
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
668
668
|
}
|
|
669
|
-
var __dxlog_file2 = "/
|
|
669
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection.ts";
|
|
670
670
|
var STARTING_SIGNALLING_DELAY = 10;
|
|
671
|
+
var TRANSPORT_CONNECTION_TIMEOUT = 1e4;
|
|
671
672
|
var MAX_SIGNALLING_DELAY = 300;
|
|
672
673
|
var ConnectionState;
|
|
673
674
|
(function(ConnectionState6) {
|
|
@@ -723,6 +724,7 @@ var Connection = class {
|
|
|
723
724
|
this._transportFactory = _transportFactory;
|
|
724
725
|
this._callbacks = _callbacks;
|
|
725
726
|
this._ctx = new import_context.Context();
|
|
727
|
+
this.connectedTimeoutContext = new import_context.Context();
|
|
726
728
|
this._state = ConnectionState.CREATED;
|
|
727
729
|
this._incomingSignalBuffer = [];
|
|
728
730
|
this._outgoingSignalBuffer = [];
|
|
@@ -741,7 +743,7 @@ var Connection = class {
|
|
|
741
743
|
initiator: this.initiator
|
|
742
744
|
}, {
|
|
743
745
|
F: __dxlog_file2,
|
|
744
|
-
L:
|
|
746
|
+
L: 129,
|
|
745
747
|
S: this,
|
|
746
748
|
C: (f, a) => f(...a)
|
|
747
749
|
});
|
|
@@ -761,7 +763,7 @@ var Connection = class {
|
|
|
761
763
|
async openConnection() {
|
|
762
764
|
(0, import_invariant.invariant)(this._state === ConnectionState.INITIAL, "Invalid state.", {
|
|
763
765
|
F: __dxlog_file2,
|
|
764
|
-
L:
|
|
766
|
+
L: 154,
|
|
765
767
|
S: this,
|
|
766
768
|
A: [
|
|
767
769
|
"this._state === ConnectionState.INITIAL",
|
|
@@ -772,7 +774,7 @@ var Connection = class {
|
|
|
772
774
|
id: this._instanceId
|
|
773
775
|
}), {
|
|
774
776
|
F: __dxlog_file2,
|
|
775
|
-
L:
|
|
777
|
+
L: 155,
|
|
776
778
|
S: this,
|
|
777
779
|
C: (f, a) => f(...a)
|
|
778
780
|
});
|
|
@@ -784,7 +786,7 @@ var Connection = class {
|
|
|
784
786
|
initiator: this.initiator
|
|
785
787
|
}, {
|
|
786
788
|
F: __dxlog_file2,
|
|
787
|
-
L:
|
|
789
|
+
L: 156,
|
|
788
790
|
S: this,
|
|
789
791
|
C: (f, a) => f(...a)
|
|
790
792
|
});
|
|
@@ -795,15 +797,24 @@ var Connection = class {
|
|
|
795
797
|
this._protocol.stream.on("close", () => {
|
|
796
798
|
(0, import_log2.log)("protocol stream closed", void 0, {
|
|
797
799
|
F: __dxlog_file2,
|
|
798
|
-
L:
|
|
800
|
+
L: 173,
|
|
799
801
|
S: this,
|
|
800
802
|
C: (f, a) => f(...a)
|
|
801
803
|
});
|
|
802
804
|
this.close(new import_protocols.ProtocolError("protocol stream closed")).catch((err) => this.errors.raise(err));
|
|
803
805
|
});
|
|
806
|
+
(0, import_async2.scheduleTask)(this.connectedTimeoutContext, async () => {
|
|
807
|
+
import_log2.log.warn("timeout waiting for transport to connect, aborting", void 0, {
|
|
808
|
+
F: __dxlog_file2,
|
|
809
|
+
L: 180,
|
|
810
|
+
S: this,
|
|
811
|
+
C: (f, a) => f(...a)
|
|
812
|
+
});
|
|
813
|
+
await this.abort().catch((err) => this.errors.raise(err));
|
|
814
|
+
}, TRANSPORT_CONNECTION_TIMEOUT);
|
|
804
815
|
(0, import_invariant.invariant)(!this._transport, void 0, {
|
|
805
816
|
F: __dxlog_file2,
|
|
806
|
-
L:
|
|
817
|
+
L: 186,
|
|
807
818
|
S: this,
|
|
808
819
|
A: [
|
|
809
820
|
"!this._transport",
|
|
@@ -815,26 +826,27 @@ var Connection = class {
|
|
|
815
826
|
stream: this._protocol.stream,
|
|
816
827
|
sendSignal: async (signal) => this._sendSignal(signal)
|
|
817
828
|
});
|
|
818
|
-
this._transport.connected.once(() => {
|
|
829
|
+
this._transport.connected.once(async () => {
|
|
819
830
|
this._changeState(ConnectionState.CONNECTED);
|
|
831
|
+
await this.connectedTimeoutContext.dispose();
|
|
820
832
|
this._callbacks?.onConnected?.();
|
|
821
833
|
});
|
|
822
834
|
this._transport.closed.once(() => {
|
|
823
835
|
this._transport = void 0;
|
|
824
836
|
(0, import_log2.log)("abort triggered by transport close", void 0, {
|
|
825
837
|
F: __dxlog_file2,
|
|
826
|
-
L:
|
|
838
|
+
L: 201,
|
|
827
839
|
S: this,
|
|
828
840
|
C: (f, a) => f(...a)
|
|
829
841
|
});
|
|
830
842
|
this.abort().catch((err) => this.errors.raise(err));
|
|
831
843
|
});
|
|
832
|
-
this._transport.errors.handle((err) => {
|
|
844
|
+
this._transport.errors.handle(async (err) => {
|
|
833
845
|
(0, import_log2.log)("transport error:", {
|
|
834
846
|
err
|
|
835
847
|
}, {
|
|
836
848
|
F: __dxlog_file2,
|
|
837
|
-
L:
|
|
849
|
+
L: 206,
|
|
838
850
|
S: this,
|
|
839
851
|
C: (f, a) => f(...a)
|
|
840
852
|
});
|
|
@@ -844,7 +856,7 @@ var Connection = class {
|
|
|
844
856
|
if (err instanceof import_protocols.ConnectionResetError) {
|
|
845
857
|
import_log2.log.warn("aborting due to transport ConnectionResetError", void 0, {
|
|
846
858
|
F: __dxlog_file2,
|
|
847
|
-
L:
|
|
859
|
+
L: 213,
|
|
848
860
|
S: this,
|
|
849
861
|
C: (f, a) => f(...a)
|
|
850
862
|
});
|
|
@@ -852,7 +864,7 @@ var Connection = class {
|
|
|
852
864
|
} else if (err instanceof import_protocols.ConnectivityError) {
|
|
853
865
|
import_log2.log.warn("aborting due to transport ConnectivityError", void 0, {
|
|
854
866
|
F: __dxlog_file2,
|
|
855
|
-
L:
|
|
867
|
+
L: 216,
|
|
856
868
|
S: this,
|
|
857
869
|
C: (f, a) => f(...a)
|
|
858
870
|
});
|
|
@@ -862,12 +874,13 @@ var Connection = class {
|
|
|
862
874
|
err
|
|
863
875
|
}, {
|
|
864
876
|
F: __dxlog_file2,
|
|
865
|
-
L:
|
|
877
|
+
L: 219,
|
|
866
878
|
S: this,
|
|
867
879
|
C: (f, a) => f(...a)
|
|
868
880
|
});
|
|
869
881
|
}
|
|
870
882
|
if (this._state !== ConnectionState.CLOSED && this._state !== ConnectionState.CLOSING) {
|
|
883
|
+
await this.connectedTimeoutContext.dispose();
|
|
871
884
|
this.errors.raise(err);
|
|
872
885
|
}
|
|
873
886
|
});
|
|
@@ -879,7 +892,7 @@ var Connection = class {
|
|
|
879
892
|
id: this._instanceId
|
|
880
893
|
}), {
|
|
881
894
|
F: __dxlog_file2,
|
|
882
|
-
L:
|
|
895
|
+
L: 235,
|
|
883
896
|
S: this,
|
|
884
897
|
C: (f, a) => f(...a)
|
|
885
898
|
});
|
|
@@ -889,30 +902,29 @@ var Connection = class {
|
|
|
889
902
|
err
|
|
890
903
|
}, {
|
|
891
904
|
F: __dxlog_file2,
|
|
892
|
-
L:
|
|
905
|
+
L: 242,
|
|
893
906
|
S: this,
|
|
894
907
|
C: (f, a) => f(...a)
|
|
895
908
|
});
|
|
896
909
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTED) {
|
|
897
910
|
(0, import_log2.log)(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
898
911
|
F: __dxlog_file2,
|
|
899
|
-
L:
|
|
912
|
+
L: 244,
|
|
900
913
|
S: this,
|
|
901
914
|
C: (f, a) => f(...a)
|
|
902
915
|
});
|
|
903
916
|
return;
|
|
904
917
|
}
|
|
918
|
+
await this.connectedTimeoutContext.dispose();
|
|
905
919
|
this._changeState(ConnectionState.ABORTING);
|
|
906
920
|
if (!this.closeReason) {
|
|
907
921
|
this.closeReason = err?.message;
|
|
908
922
|
}
|
|
909
923
|
await this._ctx.dispose();
|
|
910
924
|
try {
|
|
911
|
-
(0, import_log2.log)("aborting protocol... ", {
|
|
912
|
-
proto: this._protocol
|
|
913
|
-
}, {
|
|
925
|
+
(0, import_log2.log)("aborting protocol... ", void 0, {
|
|
914
926
|
F: __dxlog_file2,
|
|
915
|
-
L:
|
|
927
|
+
L: 258,
|
|
916
928
|
S: this,
|
|
917
929
|
C: (f, a) => f(...a)
|
|
918
930
|
});
|
|
@@ -920,7 +932,7 @@ var Connection = class {
|
|
|
920
932
|
} catch (err2) {
|
|
921
933
|
import_log2.log.catch(err2, void 0, {
|
|
922
934
|
F: __dxlog_file2,
|
|
923
|
-
L:
|
|
935
|
+
L: 261,
|
|
924
936
|
S: this,
|
|
925
937
|
C: (f, a) => f(...a)
|
|
926
938
|
});
|
|
@@ -930,7 +942,7 @@ var Connection = class {
|
|
|
930
942
|
} catch (err2) {
|
|
931
943
|
import_log2.log.catch(err2, void 0, {
|
|
932
944
|
F: __dxlog_file2,
|
|
933
|
-
L:
|
|
945
|
+
L: 268,
|
|
934
946
|
S: this,
|
|
935
947
|
C: (f, a) => f(...a)
|
|
936
948
|
});
|
|
@@ -940,7 +952,7 @@ var Connection = class {
|
|
|
940
952
|
} catch (err2) {
|
|
941
953
|
import_log2.log.catch(err2, void 0, {
|
|
942
954
|
F: __dxlog_file2,
|
|
943
|
-
L:
|
|
955
|
+
L: 274,
|
|
944
956
|
S: this,
|
|
945
957
|
C: (f, a) => f(...a)
|
|
946
958
|
});
|
|
@@ -950,18 +962,21 @@ var Connection = class {
|
|
|
950
962
|
async close(err) {
|
|
951
963
|
if (!this.closeReason) {
|
|
952
964
|
this.closeReason = err?.message;
|
|
965
|
+
} else {
|
|
966
|
+
this.closeReason += `; ${err?.message}`;
|
|
953
967
|
}
|
|
954
968
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTING || this._state === ConnectionState.ABORTED) {
|
|
955
969
|
return;
|
|
956
970
|
}
|
|
957
971
|
const lastState = this._state;
|
|
958
972
|
this._changeState(ConnectionState.CLOSING);
|
|
973
|
+
await this.connectedTimeoutContext.dispose();
|
|
959
974
|
await this._ctx.dispose();
|
|
960
975
|
(0, import_log2.log)("closing...", {
|
|
961
976
|
peerId: this.ownId
|
|
962
977
|
}, {
|
|
963
978
|
F: __dxlog_file2,
|
|
964
|
-
L:
|
|
979
|
+
L: 299,
|
|
965
980
|
S: this,
|
|
966
981
|
C: (f, a) => f(...a)
|
|
967
982
|
});
|
|
@@ -971,7 +986,7 @@ var Connection = class {
|
|
|
971
986
|
} catch (err2) {
|
|
972
987
|
import_log2.log.catch(err2, void 0, {
|
|
973
988
|
F: __dxlog_file2,
|
|
974
|
-
L:
|
|
989
|
+
L: 306,
|
|
975
990
|
S: this,
|
|
976
991
|
C: (f, a) => f(...a)
|
|
977
992
|
});
|
|
@@ -981,7 +996,7 @@ var Connection = class {
|
|
|
981
996
|
} catch (err2) {
|
|
982
997
|
import_log2.log.catch(err2, void 0, {
|
|
983
998
|
F: __dxlog_file2,
|
|
984
|
-
L:
|
|
999
|
+
L: 313,
|
|
985
1000
|
S: this,
|
|
986
1001
|
C: (f, a) => f(...a)
|
|
987
1002
|
});
|
|
@@ -991,7 +1006,7 @@ var Connection = class {
|
|
|
991
1006
|
peerId: this.ownId
|
|
992
1007
|
}, {
|
|
993
1008
|
F: __dxlog_file2,
|
|
994
|
-
L:
|
|
1009
|
+
L: 317,
|
|
995
1010
|
S: this,
|
|
996
1011
|
C: (f, a) => f(...a)
|
|
997
1012
|
});
|
|
@@ -1027,14 +1042,14 @@ var Connection = class {
|
|
|
1027
1042
|
}
|
|
1028
1043
|
});
|
|
1029
1044
|
} catch (err) {
|
|
1030
|
-
if (err instanceof import_protocols.CancelledError) {
|
|
1045
|
+
if (err instanceof import_protocols.CancelledError || err instanceof Error && err.message?.includes("CANCELLED")) {
|
|
1031
1046
|
return;
|
|
1032
1047
|
}
|
|
1033
1048
|
import_log2.log.warn("signal failed", {
|
|
1034
1049
|
err
|
|
1035
1050
|
}, {
|
|
1036
1051
|
F: __dxlog_file2,
|
|
1037
|
-
L:
|
|
1052
|
+
L: 355,
|
|
1038
1053
|
S: this,
|
|
1039
1054
|
C: (f, a) => f(...a)
|
|
1040
1055
|
});
|
|
@@ -1047,7 +1062,7 @@ var Connection = class {
|
|
|
1047
1062
|
async signal(msg) {
|
|
1048
1063
|
(0, import_invariant.invariant)(msg.sessionId, void 0, {
|
|
1049
1064
|
F: __dxlog_file2,
|
|
1050
|
-
L:
|
|
1065
|
+
L: 364,
|
|
1051
1066
|
S: this,
|
|
1052
1067
|
A: [
|
|
1053
1068
|
"msg.sessionId",
|
|
@@ -1057,7 +1072,7 @@ var Connection = class {
|
|
|
1057
1072
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
1058
1073
|
(0, import_log2.log)("dropping signal for incorrect session id", void 0, {
|
|
1059
1074
|
F: __dxlog_file2,
|
|
1060
|
-
L:
|
|
1075
|
+
L: 366,
|
|
1061
1076
|
S: this,
|
|
1062
1077
|
C: (f, a) => f(...a)
|
|
1063
1078
|
});
|
|
@@ -1065,7 +1080,7 @@ var Connection = class {
|
|
|
1065
1080
|
}
|
|
1066
1081
|
(0, import_invariant.invariant)(msg.data.signal || msg.data.signalBatch, void 0, {
|
|
1067
1082
|
F: __dxlog_file2,
|
|
1068
|
-
L:
|
|
1083
|
+
L: 369,
|
|
1069
1084
|
S: this,
|
|
1070
1085
|
A: [
|
|
1071
1086
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -1074,7 +1089,7 @@ var Connection = class {
|
|
|
1074
1089
|
});
|
|
1075
1090
|
(0, import_invariant.invariant)(msg.author?.equals(this.remoteId), void 0, {
|
|
1076
1091
|
F: __dxlog_file2,
|
|
1077
|
-
L:
|
|
1092
|
+
L: 370,
|
|
1078
1093
|
S: this,
|
|
1079
1094
|
A: [
|
|
1080
1095
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -1083,7 +1098,7 @@ var Connection = class {
|
|
|
1083
1098
|
});
|
|
1084
1099
|
(0, import_invariant.invariant)(msg.recipient?.equals(this.ownId), void 0, {
|
|
1085
1100
|
F: __dxlog_file2,
|
|
1086
|
-
L:
|
|
1101
|
+
L: 371,
|
|
1087
1102
|
S: this,
|
|
1088
1103
|
A: [
|
|
1089
1104
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -1107,7 +1122,7 @@ var Connection = class {
|
|
|
1107
1122
|
msg: msg.data
|
|
1108
1123
|
}, {
|
|
1109
1124
|
F: __dxlog_file2,
|
|
1110
|
-
L:
|
|
1125
|
+
L: 380,
|
|
1111
1126
|
S: this,
|
|
1112
1127
|
C: (f, a) => f(...a)
|
|
1113
1128
|
});
|
|
@@ -1115,7 +1130,7 @@ var Connection = class {
|
|
|
1115
1130
|
} else {
|
|
1116
1131
|
(0, import_invariant.invariant)(this._transport, "Connection not ready to accept signals.", {
|
|
1117
1132
|
F: __dxlog_file2,
|
|
1118
|
-
L:
|
|
1133
|
+
L: 383,
|
|
1119
1134
|
S: this,
|
|
1120
1135
|
A: [
|
|
1121
1136
|
"this._transport",
|
|
@@ -1128,7 +1143,7 @@ var Connection = class {
|
|
|
1128
1143
|
msg: msg.data
|
|
1129
1144
|
}, {
|
|
1130
1145
|
F: __dxlog_file2,
|
|
1131
|
-
L:
|
|
1146
|
+
L: 384,
|
|
1132
1147
|
S: this,
|
|
1133
1148
|
C: (f, a) => f(...a)
|
|
1134
1149
|
});
|
|
@@ -1146,13 +1161,13 @@ var Connection = class {
|
|
|
1146
1161
|
peerId: this.ownId
|
|
1147
1162
|
}, {
|
|
1148
1163
|
F: __dxlog_file2,
|
|
1149
|
-
L:
|
|
1164
|
+
L: 395,
|
|
1150
1165
|
S: this,
|
|
1151
1166
|
C: (f, a) => f(...a)
|
|
1152
1167
|
});
|
|
1153
1168
|
(0, import_invariant.invariant)(state !== this._state, "Already in this state.", {
|
|
1154
1169
|
F: __dxlog_file2,
|
|
1155
|
-
L:
|
|
1170
|
+
L: 396,
|
|
1156
1171
|
S: this,
|
|
1157
1172
|
A: [
|
|
1158
1173
|
"state !== this._state",
|
|
@@ -1197,7 +1212,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
1197
1212
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1198
1213
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1199
1214
|
}
|
|
1200
|
-
var __dxlog_file3 = "/
|
|
1215
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/peer.ts";
|
|
1201
1216
|
var ConnectionDisplacedError = class extends import_protocols2.SystemError {
|
|
1202
1217
|
constructor() {
|
|
1203
1218
|
super("Connection displaced by remote initiator.");
|
|
@@ -1229,11 +1244,12 @@ var Peer = class {
|
|
|
1229
1244
|
const remoteId = message.author;
|
|
1230
1245
|
if (this.connection && ![
|
|
1231
1246
|
ConnectionState.CREATED,
|
|
1232
|
-
ConnectionState.INITIAL
|
|
1247
|
+
ConnectionState.INITIAL,
|
|
1248
|
+
ConnectionState.CONNECTING
|
|
1233
1249
|
].includes(this.connection.state)) {
|
|
1234
1250
|
import_log3.log.info(`received offer when connection already in ${this.connection.state} state`, void 0, {
|
|
1235
1251
|
F: __dxlog_file3,
|
|
1236
|
-
L:
|
|
1252
|
+
L: 115,
|
|
1237
1253
|
S: this,
|
|
1238
1254
|
C: (f, a) => f(...a)
|
|
1239
1255
|
});
|
|
@@ -1250,7 +1266,7 @@ var Peer = class {
|
|
|
1250
1266
|
sessionId: this.connection?.sessionId
|
|
1251
1267
|
}, {
|
|
1252
1268
|
F: __dxlog_file3,
|
|
1253
|
-
L:
|
|
1269
|
+
L: 124,
|
|
1254
1270
|
S: this,
|
|
1255
1271
|
C: (f, a) => f(...a)
|
|
1256
1272
|
});
|
|
@@ -1267,7 +1283,7 @@ var Peer = class {
|
|
|
1267
1283
|
if (!this.connection) {
|
|
1268
1284
|
(0, import_invariant2.invariant)(message.sessionId, void 0, {
|
|
1269
1285
|
F: __dxlog_file3,
|
|
1270
|
-
L:
|
|
1286
|
+
L: 144,
|
|
1271
1287
|
S: this,
|
|
1272
1288
|
A: [
|
|
1273
1289
|
"message.sessionId",
|
|
@@ -1288,7 +1304,7 @@ var Peer = class {
|
|
|
1288
1304
|
err
|
|
1289
1305
|
}, {
|
|
1290
1306
|
F: __dxlog_file3,
|
|
1291
|
-
L:
|
|
1307
|
+
L: 154,
|
|
1292
1308
|
S: this,
|
|
1293
1309
|
C: (f, a) => f(...a)
|
|
1294
1310
|
});
|
|
@@ -1310,7 +1326,7 @@ var Peer = class {
|
|
|
1310
1326
|
async initiateConnection() {
|
|
1311
1327
|
(0, import_invariant2.invariant)(!this.initiating, "Initiation in progress.", {
|
|
1312
1328
|
F: __dxlog_file3,
|
|
1313
|
-
L:
|
|
1329
|
+
L: 171,
|
|
1314
1330
|
S: this,
|
|
1315
1331
|
A: [
|
|
1316
1332
|
"!this.initiating",
|
|
@@ -1319,7 +1335,7 @@ var Peer = class {
|
|
|
1319
1335
|
});
|
|
1320
1336
|
(0, import_invariant2.invariant)(!this.connection, "Already connected.", {
|
|
1321
1337
|
F: __dxlog_file3,
|
|
1322
|
-
L:
|
|
1338
|
+
L: 172,
|
|
1323
1339
|
S: this,
|
|
1324
1340
|
A: [
|
|
1325
1341
|
"!this.connection",
|
|
@@ -1334,16 +1350,17 @@ var Peer = class {
|
|
|
1334
1350
|
sessionId
|
|
1335
1351
|
}, {
|
|
1336
1352
|
F: __dxlog_file3,
|
|
1337
|
-
L:
|
|
1353
|
+
L: 174,
|
|
1338
1354
|
S: this,
|
|
1339
1355
|
C: (f, a) => f(...a)
|
|
1340
1356
|
});
|
|
1341
1357
|
const connection = this._createConnection(true, sessionId);
|
|
1342
1358
|
this.initiating = true;
|
|
1359
|
+
let answer;
|
|
1343
1360
|
try {
|
|
1344
1361
|
await this._connectionLimiter.connecting(sessionId);
|
|
1345
1362
|
connection.initiate();
|
|
1346
|
-
|
|
1363
|
+
answer = await this._signalMessaging.offer({
|
|
1347
1364
|
author: this.localPeerId,
|
|
1348
1365
|
recipient: this.id,
|
|
1349
1366
|
sessionId,
|
|
@@ -1359,46 +1376,87 @@ var Peer = class {
|
|
|
1359
1376
|
remoteId: this.id
|
|
1360
1377
|
}, {
|
|
1361
1378
|
F: __dxlog_file3,
|
|
1362
|
-
L:
|
|
1379
|
+
L: 191,
|
|
1363
1380
|
S: this,
|
|
1364
1381
|
C: (f, a) => f(...a)
|
|
1365
1382
|
});
|
|
1366
1383
|
if (connection.state !== ConnectionState.INITIAL) {
|
|
1367
1384
|
(0, import_log3.log)("ignoring response", void 0, {
|
|
1368
1385
|
F: __dxlog_file3,
|
|
1369
|
-
L:
|
|
1386
|
+
L: 193,
|
|
1370
1387
|
S: this,
|
|
1371
1388
|
C: (f, a) => f(...a)
|
|
1372
1389
|
});
|
|
1373
1390
|
return;
|
|
1374
1391
|
}
|
|
1392
|
+
} catch (err) {
|
|
1393
|
+
(0, import_log3.log)("initiation error: send offer", {
|
|
1394
|
+
err,
|
|
1395
|
+
topic: this.topic,
|
|
1396
|
+
peerId: this.localPeerId,
|
|
1397
|
+
remoteId: this.id
|
|
1398
|
+
}, {
|
|
1399
|
+
F: __dxlog_file3,
|
|
1400
|
+
L: 197,
|
|
1401
|
+
S: this,
|
|
1402
|
+
C: (f, a) => f(...a)
|
|
1403
|
+
});
|
|
1404
|
+
await connection.abort(err);
|
|
1405
|
+
throw err;
|
|
1406
|
+
} finally {
|
|
1407
|
+
this.initiating = false;
|
|
1408
|
+
}
|
|
1409
|
+
try {
|
|
1375
1410
|
if (!answer.accept) {
|
|
1376
1411
|
this._callbacks.onRejected();
|
|
1377
1412
|
return;
|
|
1378
1413
|
}
|
|
1414
|
+
} catch (err) {
|
|
1415
|
+
(0, import_log3.log)("initiation error: accept answer", {
|
|
1416
|
+
err,
|
|
1417
|
+
topic: this.topic,
|
|
1418
|
+
peerId: this.localPeerId,
|
|
1419
|
+
remoteId: this.id
|
|
1420
|
+
}, {
|
|
1421
|
+
F: __dxlog_file3,
|
|
1422
|
+
L: 210,
|
|
1423
|
+
S: this,
|
|
1424
|
+
C: (f, a) => f(...a)
|
|
1425
|
+
});
|
|
1426
|
+
await connection.abort(err);
|
|
1427
|
+
throw err;
|
|
1428
|
+
} finally {
|
|
1429
|
+
this.initiating = false;
|
|
1430
|
+
}
|
|
1431
|
+
try {
|
|
1432
|
+
(0, import_log3.log)("opening connection as initiator", void 0, {
|
|
1433
|
+
F: __dxlog_file3,
|
|
1434
|
+
L: 223,
|
|
1435
|
+
S: this,
|
|
1436
|
+
C: (f, a) => f(...a)
|
|
1437
|
+
});
|
|
1379
1438
|
await connection.openConnection();
|
|
1380
1439
|
this._callbacks.onAccepted();
|
|
1381
1440
|
} catch (err) {
|
|
1382
|
-
(0, import_log3.log)("initiation error", {
|
|
1441
|
+
(0, import_log3.log)("initiation error: open connection", {
|
|
1383
1442
|
err,
|
|
1384
1443
|
topic: this.topic,
|
|
1385
1444
|
peerId: this.localPeerId,
|
|
1386
1445
|
remoteId: this.id
|
|
1387
1446
|
}, {
|
|
1388
1447
|
F: __dxlog_file3,
|
|
1389
|
-
L:
|
|
1448
|
+
L: 227,
|
|
1449
|
+
S: this,
|
|
1450
|
+
C: (f, a) => f(...a)
|
|
1451
|
+
});
|
|
1452
|
+
import_log3.log.warn("closing connection due to unhandled error on openConnection", {
|
|
1453
|
+
err
|
|
1454
|
+
}, {
|
|
1455
|
+
F: __dxlog_file3,
|
|
1456
|
+
L: 234,
|
|
1390
1457
|
S: this,
|
|
1391
1458
|
C: (f, a) => f(...a)
|
|
1392
1459
|
});
|
|
1393
|
-
if (err instanceof import_protocols2.TimeoutError) {
|
|
1394
|
-
import_log3.log.warn("aborting connection due to signalling failure", void 0, {
|
|
1395
|
-
F: __dxlog_file3,
|
|
1396
|
-
L: 202,
|
|
1397
|
-
S: this,
|
|
1398
|
-
C: (f, a) => f(...a)
|
|
1399
|
-
});
|
|
1400
|
-
await connection.abort(err);
|
|
1401
|
-
}
|
|
1402
1460
|
await this.closeConnection(err);
|
|
1403
1461
|
throw err;
|
|
1404
1462
|
} finally {
|
|
@@ -1418,13 +1476,13 @@ var Peer = class {
|
|
|
1418
1476
|
sessionId
|
|
1419
1477
|
}, {
|
|
1420
1478
|
F: __dxlog_file3,
|
|
1421
|
-
L:
|
|
1479
|
+
L: 248,
|
|
1422
1480
|
S: this,
|
|
1423
1481
|
C: (f, a) => f(...a)
|
|
1424
1482
|
});
|
|
1425
1483
|
(0, import_invariant2.invariant)(!this.connection, "Already connected.", {
|
|
1426
1484
|
F: __dxlog_file3,
|
|
1427
|
-
L:
|
|
1485
|
+
L: 255,
|
|
1428
1486
|
S: this,
|
|
1429
1487
|
A: [
|
|
1430
1488
|
"!this.connection",
|
|
@@ -1460,7 +1518,7 @@ var Peer = class {
|
|
|
1460
1518
|
initiator
|
|
1461
1519
|
}, {
|
|
1462
1520
|
F: __dxlog_file3,
|
|
1463
|
-
L:
|
|
1521
|
+
L: 274,
|
|
1464
1522
|
S: this,
|
|
1465
1523
|
C: (f, a) => f(...a)
|
|
1466
1524
|
});
|
|
@@ -1473,14 +1531,14 @@ var Peer = class {
|
|
|
1473
1531
|
initiator
|
|
1474
1532
|
}, {
|
|
1475
1533
|
F: __dxlog_file3,
|
|
1476
|
-
L:
|
|
1534
|
+
L: 283,
|
|
1477
1535
|
S: this,
|
|
1478
1536
|
C: (f, a) => f(...a)
|
|
1479
1537
|
});
|
|
1480
1538
|
this._connectionLimiter.doneConnecting(sessionId);
|
|
1481
1539
|
(0, import_invariant2.invariant)(this.connection === connection, "Connection mismatch (race condition).", {
|
|
1482
1540
|
F: __dxlog_file3,
|
|
1483
|
-
L:
|
|
1541
|
+
L: 288,
|
|
1484
1542
|
S: this,
|
|
1485
1543
|
A: [
|
|
1486
1544
|
"this.connection === connection",
|
|
@@ -1495,7 +1553,7 @@ var Peer = class {
|
|
|
1495
1553
|
initiator
|
|
1496
1554
|
}, {
|
|
1497
1555
|
F: __dxlog_file3,
|
|
1498
|
-
L:
|
|
1556
|
+
L: 290,
|
|
1499
1557
|
S: this,
|
|
1500
1558
|
C: (f, a) => f(...a)
|
|
1501
1559
|
});
|
|
@@ -1522,7 +1580,7 @@ var Peer = class {
|
|
|
1522
1580
|
void this._connectionCtx?.dispose();
|
|
1523
1581
|
this._connectionCtx = this._ctx.derive();
|
|
1524
1582
|
connection.errors.handle((err) => {
|
|
1525
|
-
import_log3.log.warn("connection error", {
|
|
1583
|
+
import_log3.log.warn("connection error, closing", {
|
|
1526
1584
|
topic: this.topic,
|
|
1527
1585
|
peerId: this.localPeerId,
|
|
1528
1586
|
remoteId: this.id,
|
|
@@ -1530,7 +1588,7 @@ var Peer = class {
|
|
|
1530
1588
|
err
|
|
1531
1589
|
}, {
|
|
1532
1590
|
F: __dxlog_file3,
|
|
1533
|
-
L:
|
|
1591
|
+
L: 330,
|
|
1534
1592
|
S: this,
|
|
1535
1593
|
C: (f, a) => f(...a)
|
|
1536
1594
|
});
|
|
@@ -1543,7 +1601,7 @@ var Peer = class {
|
|
|
1543
1601
|
err
|
|
1544
1602
|
}, {
|
|
1545
1603
|
F: __dxlog_file3,
|
|
1546
|
-
L:
|
|
1604
|
+
L: 337,
|
|
1547
1605
|
S: this,
|
|
1548
1606
|
C: (f, a) => f(...a)
|
|
1549
1607
|
});
|
|
@@ -1562,7 +1620,7 @@ var Peer = class {
|
|
|
1562
1620
|
sessionId: connection.sessionId
|
|
1563
1621
|
}, {
|
|
1564
1622
|
F: __dxlog_file3,
|
|
1565
|
-
L:
|
|
1623
|
+
L: 362,
|
|
1566
1624
|
S: this,
|
|
1567
1625
|
C: (f, a) => f(...a)
|
|
1568
1626
|
});
|
|
@@ -1572,7 +1630,7 @@ var Peer = class {
|
|
|
1572
1630
|
sessionId: connection.sessionId
|
|
1573
1631
|
}, {
|
|
1574
1632
|
F: __dxlog_file3,
|
|
1575
|
-
L:
|
|
1633
|
+
L: 368,
|
|
1576
1634
|
S: this,
|
|
1577
1635
|
C: (f, a) => f(...a)
|
|
1578
1636
|
});
|
|
@@ -1583,7 +1641,7 @@ var Peer = class {
|
|
|
1583
1641
|
message
|
|
1584
1642
|
}, {
|
|
1585
1643
|
F: __dxlog_file3,
|
|
1586
|
-
L:
|
|
1644
|
+
L: 373,
|
|
1587
1645
|
S: this,
|
|
1588
1646
|
C: (f, a) => f(...a)
|
|
1589
1647
|
});
|
|
@@ -1591,18 +1649,18 @@ var Peer = class {
|
|
|
1591
1649
|
}
|
|
1592
1650
|
await this.connection.signal(message);
|
|
1593
1651
|
}
|
|
1594
|
-
async destroy() {
|
|
1652
|
+
async destroy(reason) {
|
|
1595
1653
|
await this._ctx.dispose();
|
|
1596
1654
|
(0, import_log3.log)("Destroying peer", {
|
|
1597
1655
|
peerId: this.id,
|
|
1598
1656
|
topic: this.topic
|
|
1599
1657
|
}, {
|
|
1600
1658
|
F: __dxlog_file3,
|
|
1601
|
-
L:
|
|
1659
|
+
L: 383,
|
|
1602
1660
|
S: this,
|
|
1603
1661
|
C: (f, a) => f(...a)
|
|
1604
1662
|
});
|
|
1605
|
-
await this?.connection?.close();
|
|
1663
|
+
await this?.connection?.close(reason);
|
|
1606
1664
|
}
|
|
1607
1665
|
};
|
|
1608
1666
|
_ts_decorate2([
|
|
@@ -1628,7 +1686,7 @@ var import_keys4 = require("@dxos/keys");
|
|
|
1628
1686
|
var import_log4 = require("@dxos/log");
|
|
1629
1687
|
var import_protocols3 = require("@dxos/protocols");
|
|
1630
1688
|
var import_util2 = require("@dxos/util");
|
|
1631
|
-
var __dxlog_file4 = "/
|
|
1689
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/signal/swarm-messenger.ts";
|
|
1632
1690
|
var SwarmMessage = import_protocols3.schema.getCodecForType("dxos.mesh.swarm.SwarmMessage");
|
|
1633
1691
|
var SwarmMessenger = class {
|
|
1634
1692
|
constructor({ sendMessage, onSignal, onOffer, topic }) {
|
|
@@ -1864,7 +1922,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
1864
1922
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1865
1923
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1866
1924
|
}
|
|
1867
|
-
var __dxlog_file5 = "/
|
|
1925
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm.ts";
|
|
1868
1926
|
var INITIATION_DELAY = 100;
|
|
1869
1927
|
var getClassName = (obj) => Object.getPrototypeOf(obj).constructor.name;
|
|
1870
1928
|
var Swarm = class {
|
|
@@ -1975,7 +2033,7 @@ var Swarm = class {
|
|
|
1975
2033
|
this._listeningHandle = void 0;
|
|
1976
2034
|
await this._ctx.dispose();
|
|
1977
2035
|
await this._topology.destroy();
|
|
1978
|
-
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key)));
|
|
2036
|
+
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key, "swarm destroyed")));
|
|
1979
2037
|
(0, import_log5.log)("destroyed", void 0, {
|
|
1980
2038
|
F: __dxlog_file5,
|
|
1981
2039
|
L: 148,
|
|
@@ -2047,13 +2105,22 @@ var Swarm = class {
|
|
|
2047
2105
|
if (peer) {
|
|
2048
2106
|
peer.advertizing = false;
|
|
2049
2107
|
if (peer.connection?.state !== ConnectionState.CONNECTED) {
|
|
2050
|
-
void this._destroyPeer(peer.id).catch((err) => import_log5.log.catch(err, void 0, {
|
|
2108
|
+
void this._destroyPeer(peer.id, "peer left").catch((err) => import_log5.log.catch(err, void 0, {
|
|
2051
2109
|
F: __dxlog_file5,
|
|
2052
2110
|
L: 189,
|
|
2053
2111
|
S: this,
|
|
2054
2112
|
C: (f, a) => f(...a)
|
|
2055
2113
|
}));
|
|
2056
2114
|
}
|
|
2115
|
+
} else {
|
|
2116
|
+
(0, import_log5.log)("received peerLeft but no peer found", {
|
|
2117
|
+
peer: swarmEvent.peerLeft.peer
|
|
2118
|
+
}, {
|
|
2119
|
+
F: __dxlog_file5,
|
|
2120
|
+
L: 192,
|
|
2121
|
+
S: this,
|
|
2122
|
+
C: (f, a) => f(...a)
|
|
2123
|
+
});
|
|
2057
2124
|
}
|
|
2058
2125
|
}
|
|
2059
2126
|
this._topology.update();
|
|
@@ -2063,14 +2130,14 @@ var Swarm = class {
|
|
|
2063
2130
|
message
|
|
2064
2131
|
}, {
|
|
2065
2132
|
F: __dxlog_file5,
|
|
2066
|
-
L:
|
|
2133
|
+
L: 201,
|
|
2067
2134
|
S: this,
|
|
2068
2135
|
C: (f, a) => f(...a)
|
|
2069
2136
|
});
|
|
2070
2137
|
if (this._ctx.disposed) {
|
|
2071
2138
|
(0, import_log5.log)("ignored for disposed swarm", void 0, {
|
|
2072
2139
|
F: __dxlog_file5,
|
|
2073
|
-
L:
|
|
2140
|
+
L: 203,
|
|
2074
2141
|
S: this,
|
|
2075
2142
|
C: (f, a) => f(...a)
|
|
2076
2143
|
});
|
|
@@ -2080,7 +2147,7 @@ var Swarm = class {
|
|
|
2080
2147
|
}
|
|
2081
2148
|
(0, import_invariant4.invariant)(message.author, void 0, {
|
|
2082
2149
|
F: __dxlog_file5,
|
|
2083
|
-
L:
|
|
2150
|
+
L: 208,
|
|
2084
2151
|
S: this,
|
|
2085
2152
|
A: [
|
|
2086
2153
|
"message.author",
|
|
@@ -2092,7 +2159,7 @@ var Swarm = class {
|
|
|
2092
2159
|
message
|
|
2093
2160
|
}, {
|
|
2094
2161
|
F: __dxlog_file5,
|
|
2095
|
-
L:
|
|
2162
|
+
L: 210,
|
|
2096
2163
|
S: this,
|
|
2097
2164
|
C: (f, a) => f(...a)
|
|
2098
2165
|
});
|
|
@@ -2105,7 +2172,7 @@ var Swarm = class {
|
|
|
2105
2172
|
message
|
|
2106
2173
|
}, {
|
|
2107
2174
|
F: __dxlog_file5,
|
|
2108
|
-
L:
|
|
2175
|
+
L: 214,
|
|
2109
2176
|
S: this,
|
|
2110
2177
|
C: (f, a) => f(...a)
|
|
2111
2178
|
});
|
|
@@ -2123,14 +2190,14 @@ var Swarm = class {
|
|
|
2123
2190
|
message
|
|
2124
2191
|
}, {
|
|
2125
2192
|
F: __dxlog_file5,
|
|
2126
|
-
L:
|
|
2193
|
+
L: 225,
|
|
2127
2194
|
S: this,
|
|
2128
2195
|
C: (f, a) => f(...a)
|
|
2129
2196
|
});
|
|
2130
2197
|
if (this._ctx.disposed) {
|
|
2131
2198
|
import_log5.log.info("ignored for offline swarm", void 0, {
|
|
2132
2199
|
F: __dxlog_file5,
|
|
2133
|
-
L:
|
|
2200
|
+
L: 227,
|
|
2134
2201
|
S: this,
|
|
2135
2202
|
C: (f, a) => f(...a)
|
|
2136
2203
|
});
|
|
@@ -2138,7 +2205,7 @@ var Swarm = class {
|
|
|
2138
2205
|
}
|
|
2139
2206
|
(0, import_invariant4.invariant)(message.recipient?.equals(this._ownPeerId), `Invalid signal peer id expected=${this.ownPeerId}, actual=${message.recipient}`, {
|
|
2140
2207
|
F: __dxlog_file5,
|
|
2141
|
-
L:
|
|
2208
|
+
L: 230,
|
|
2142
2209
|
S: this,
|
|
2143
2210
|
A: [
|
|
2144
2211
|
"message.recipient?.equals(this._ownPeerId)",
|
|
@@ -2147,7 +2214,7 @@ var Swarm = class {
|
|
|
2147
2214
|
});
|
|
2148
2215
|
(0, import_invariant4.invariant)(message.topic?.equals(this._topic), void 0, {
|
|
2149
2216
|
F: __dxlog_file5,
|
|
2150
|
-
L:
|
|
2217
|
+
L: 234,
|
|
2151
2218
|
S: this,
|
|
2152
2219
|
A: [
|
|
2153
2220
|
"message.topic?.equals(this._topic)",
|
|
@@ -2156,7 +2223,7 @@ var Swarm = class {
|
|
|
2156
2223
|
});
|
|
2157
2224
|
(0, import_invariant4.invariant)(message.author, void 0, {
|
|
2158
2225
|
F: __dxlog_file5,
|
|
2159
|
-
L:
|
|
2226
|
+
L: 235,
|
|
2160
2227
|
S: this,
|
|
2161
2228
|
A: [
|
|
2162
2229
|
"message.author",
|
|
@@ -2171,7 +2238,7 @@ var Swarm = class {
|
|
|
2171
2238
|
await this._ctx.dispose();
|
|
2172
2239
|
await Promise.all([
|
|
2173
2240
|
...this._peers.keys()
|
|
2174
|
-
].map((peerId) => this._destroyPeer(peerId)));
|
|
2241
|
+
].map((peerId) => this._destroyPeer(peerId, "goOffline")));
|
|
2175
2242
|
}
|
|
2176
2243
|
// For debug purposes
|
|
2177
2244
|
async goOnline() {
|
|
@@ -2189,14 +2256,22 @@ var Swarm = class {
|
|
|
2189
2256
|
},
|
|
2190
2257
|
onDisconnected: async () => {
|
|
2191
2258
|
if (!peer.advertizing) {
|
|
2192
|
-
await this._destroyPeer(peer.id);
|
|
2259
|
+
await this._destroyPeer(peer.id, "peer disconnected");
|
|
2193
2260
|
}
|
|
2194
2261
|
this.disconnected.emit(peerId);
|
|
2195
2262
|
this._topology.update();
|
|
2196
2263
|
},
|
|
2197
2264
|
onRejected: () => {
|
|
2198
2265
|
if (this._peers.has(peerId)) {
|
|
2199
|
-
|
|
2266
|
+
(0, import_log5.log)("peer rejected connection", {
|
|
2267
|
+
peerId
|
|
2268
|
+
}, {
|
|
2269
|
+
F: __dxlog_file5,
|
|
2270
|
+
L: 284,
|
|
2271
|
+
S: this,
|
|
2272
|
+
C: (f, a) => f(...a)
|
|
2273
|
+
});
|
|
2274
|
+
void this._destroyPeer(peerId, "peer rejected connection");
|
|
2200
2275
|
}
|
|
2201
2276
|
},
|
|
2202
2277
|
onAccepted: () => {
|
|
@@ -2213,17 +2288,17 @@ var Swarm = class {
|
|
|
2213
2288
|
}
|
|
2214
2289
|
return peer;
|
|
2215
2290
|
}
|
|
2216
|
-
async _destroyPeer(peerId) {
|
|
2291
|
+
async _destroyPeer(peerId, reason) {
|
|
2217
2292
|
(0, import_invariant4.invariant)(this._peers.has(peerId), void 0, {
|
|
2218
2293
|
F: __dxlog_file5,
|
|
2219
|
-
L:
|
|
2294
|
+
L: 306,
|
|
2220
2295
|
S: this,
|
|
2221
2296
|
A: [
|
|
2222
2297
|
"this._peers.has(peerId)",
|
|
2223
2298
|
""
|
|
2224
2299
|
]
|
|
2225
2300
|
});
|
|
2226
|
-
await this._peers.get(peerId).destroy();
|
|
2301
|
+
await this._peers.get(peerId).destroy(new Error(reason));
|
|
2227
2302
|
this._peers.delete(peerId);
|
|
2228
2303
|
}
|
|
2229
2304
|
_getSwarmController() {
|
|
@@ -2243,7 +2318,7 @@ var Swarm = class {
|
|
|
2243
2318
|
} catch (err) {
|
|
2244
2319
|
(0, import_log5.log)("initiation error", err, {
|
|
2245
2320
|
F: __dxlog_file5,
|
|
2246
|
-
L:
|
|
2321
|
+
L: 332,
|
|
2247
2322
|
S: this,
|
|
2248
2323
|
C: (f, a) => f(...a)
|
|
2249
2324
|
});
|
|
@@ -2271,7 +2346,7 @@ var Swarm = class {
|
|
|
2271
2346
|
remoteId
|
|
2272
2347
|
}, {
|
|
2273
2348
|
F: __dxlog_file5,
|
|
2274
|
-
L:
|
|
2349
|
+
L: 359,
|
|
2275
2350
|
S: this,
|
|
2276
2351
|
C: (f, a) => f(...a)
|
|
2277
2352
|
});
|
|
@@ -2288,7 +2363,7 @@ var Swarm = class {
|
|
|
2288
2363
|
remoteId
|
|
2289
2364
|
}, {
|
|
2290
2365
|
F: __dxlog_file5,
|
|
2291
|
-
L:
|
|
2366
|
+
L: 373,
|
|
2292
2367
|
S: this,
|
|
2293
2368
|
C: (f, a) => f(...a)
|
|
2294
2369
|
});
|
|
@@ -2298,7 +2373,7 @@ var Swarm = class {
|
|
|
2298
2373
|
remoteId
|
|
2299
2374
|
}, {
|
|
2300
2375
|
F: __dxlog_file5,
|
|
2301
|
-
L:
|
|
2376
|
+
L: 376,
|
|
2302
2377
|
S: this,
|
|
2303
2378
|
C: (f, a) => f(...a)
|
|
2304
2379
|
});
|
|
@@ -2338,7 +2413,7 @@ var import_async5 = require("@dxos/async");
|
|
|
2338
2413
|
var import_keys6 = require("@dxos/keys");
|
|
2339
2414
|
var import_log6 = require("@dxos/log");
|
|
2340
2415
|
var import_util4 = require("@dxos/util");
|
|
2341
|
-
var __dxlog_file6 = "/
|
|
2416
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm-mapper.ts";
|
|
2342
2417
|
var SwarmMapper = class {
|
|
2343
2418
|
get peers() {
|
|
2344
2419
|
return Array.from(this._peers.values());
|
|
@@ -2410,7 +2485,7 @@ var import_keys7 = require("@dxos/keys");
|
|
|
2410
2485
|
var import_log7 = require("@dxos/log");
|
|
2411
2486
|
var import_protocols5 = require("@dxos/protocols");
|
|
2412
2487
|
var import_util5 = require("@dxos/util");
|
|
2413
|
-
var __dxlog_file7 = "/
|
|
2488
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection-limiter.ts";
|
|
2414
2489
|
var MAX_CONCURRENT_INITIATING_CONNECTIONS = 50;
|
|
2415
2490
|
var ConnectionLimiter = class {
|
|
2416
2491
|
constructor({ maxConcurrentInitConnections = MAX_CONCURRENT_INITIATING_CONNECTIONS } = {}) {
|
|
@@ -2551,7 +2626,7 @@ var ConnectionLog = class {
|
|
|
2551
2626
|
};
|
|
2552
2627
|
|
|
2553
2628
|
// packages/core/mesh/network-manager/src/network-manager.ts
|
|
2554
|
-
var __dxlog_file8 = "/
|
|
2629
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/network-manager.ts";
|
|
2555
2630
|
var NetworkManager = class {
|
|
2556
2631
|
constructor({ transportFactory, signalManager, log: log1 }) {
|
|
2557
2632
|
/**
|
|
@@ -2787,7 +2862,7 @@ var NetworkManager = class {
|
|
|
2787
2862
|
|
|
2788
2863
|
// packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts
|
|
2789
2864
|
var import_invariant7 = require("@dxos/invariant");
|
|
2790
|
-
var __dxlog_file9 = "/
|
|
2865
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts";
|
|
2791
2866
|
var FullyConnectedTopology = class {
|
|
2792
2867
|
toString() {
|
|
2793
2868
|
return "FullyConnectedTopology";
|
|
@@ -2853,7 +2928,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
2853
2928
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2854
2929
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2855
2930
|
}
|
|
2856
|
-
var __dxlog_file10 = "/
|
|
2931
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/memory-transport.ts";
|
|
2857
2932
|
var MEMORY_TRANSPORT_DELAY = 1;
|
|
2858
2933
|
var createStreamDelay = (delay) => {
|
|
2859
2934
|
return new import_node_stream.Transform({
|
|
@@ -3048,7 +3123,7 @@ try {
|
|
|
3048
3123
|
}
|
|
3049
3124
|
|
|
3050
3125
|
// packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts
|
|
3051
|
-
var __dxlog_file11 = "/
|
|
3126
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts";
|
|
3052
3127
|
var SimplePeerTransport = class {
|
|
3053
3128
|
constructor(params) {
|
|
3054
3129
|
this.params = params;
|
|
@@ -3237,7 +3312,7 @@ var import_keys12 = require("@dxos/keys");
|
|
|
3237
3312
|
var import_log13 = require("@dxos/log");
|
|
3238
3313
|
var import_bridge = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
3239
3314
|
var import_util9 = require("@dxos/util");
|
|
3240
|
-
var __dxlog_file12 = "/
|
|
3315
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-service.ts";
|
|
3241
3316
|
var SimplePeerTransportService = class {
|
|
3242
3317
|
constructor(_webrtcConfig) {
|
|
3243
3318
|
this._webrtcConfig = _webrtcConfig;
|
|
@@ -3380,7 +3455,7 @@ var import_log14 = require("@dxos/log");
|
|
|
3380
3455
|
var import_protocols8 = require("@dxos/protocols");
|
|
3381
3456
|
var import_bridge2 = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
3382
3457
|
var import_util10 = require("@dxos/util");
|
|
3383
|
-
var __dxlog_file13 = "/
|
|
3458
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-proxy.ts";
|
|
3384
3459
|
var SimplePeerTransportProxy = class {
|
|
3385
3460
|
constructor(_params) {
|
|
3386
3461
|
this._params = _params;
|
|
@@ -3560,7 +3635,7 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3560
3635
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3561
3636
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3562
3637
|
}
|
|
3563
|
-
var __dxlog_file14 = "/
|
|
3638
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/libdatachannel-transport.ts";
|
|
3564
3639
|
var DATACHANNEL_LABEL = "dxos.mesh.transport";
|
|
3565
3640
|
var MAX_BUFFERED_AMOUNT = 64 * 1024;
|
|
3566
3641
|
var MAX_MESSAGE_SIZE = 64 * 1024;
|
|
@@ -3889,7 +3964,7 @@ var import_node_net = require("node:net");
|
|
|
3889
3964
|
var import_async13 = require("@dxos/async");
|
|
3890
3965
|
var import_debug8 = require("@dxos/debug");
|
|
3891
3966
|
var import_log16 = require("@dxos/log");
|
|
3892
|
-
var __dxlog_file15 = "/
|
|
3967
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/tcp-transport.ts";
|
|
3893
3968
|
var TcpTransportFactory = {
|
|
3894
3969
|
createTransport: (params) => new TcpTransport(params)
|
|
3895
3970
|
};
|
|
@@ -4015,7 +4090,7 @@ var TcpTransport = class {
|
|
|
4015
4090
|
};
|
|
4016
4091
|
|
|
4017
4092
|
// packages/core/mesh/network-manager/src/testing/test-builder.ts
|
|
4018
|
-
var __dxlog_file16 = "/
|
|
4093
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/testing/test-builder.ts";
|
|
4019
4094
|
var port = process.env.SIGNAL_PORT ?? 4e3;
|
|
4020
4095
|
var TEST_SIGNAL_HOSTS = [
|
|
4021
4096
|
{
|