@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
package/dist/lib/node/index.cjs
CHANGED
|
@@ -561,8 +561,9 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
561
561
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
562
562
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
563
563
|
}
|
|
564
|
-
var __dxlog_file = "/
|
|
564
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection.ts";
|
|
565
565
|
var STARTING_SIGNALLING_DELAY = 10;
|
|
566
|
+
var TRANSPORT_CONNECTION_TIMEOUT = 1e4;
|
|
566
567
|
var MAX_SIGNALLING_DELAY = 300;
|
|
567
568
|
var ConnectionState;
|
|
568
569
|
(function(ConnectionState5) {
|
|
@@ -618,6 +619,7 @@ var Connection = class {
|
|
|
618
619
|
this._transportFactory = _transportFactory;
|
|
619
620
|
this._callbacks = _callbacks;
|
|
620
621
|
this._ctx = new import_context.Context();
|
|
622
|
+
this.connectedTimeoutContext = new import_context.Context();
|
|
621
623
|
this._state = ConnectionState.CREATED;
|
|
622
624
|
this._incomingSignalBuffer = [];
|
|
623
625
|
this._outgoingSignalBuffer = [];
|
|
@@ -636,7 +638,7 @@ var Connection = class {
|
|
|
636
638
|
initiator: this.initiator
|
|
637
639
|
}, {
|
|
638
640
|
F: __dxlog_file,
|
|
639
|
-
L:
|
|
641
|
+
L: 129,
|
|
640
642
|
S: this,
|
|
641
643
|
C: (f, a) => f(...a)
|
|
642
644
|
});
|
|
@@ -656,7 +658,7 @@ var Connection = class {
|
|
|
656
658
|
async openConnection() {
|
|
657
659
|
(0, import_invariant.invariant)(this._state === ConnectionState.INITIAL, "Invalid state.", {
|
|
658
660
|
F: __dxlog_file,
|
|
659
|
-
L:
|
|
661
|
+
L: 154,
|
|
660
662
|
S: this,
|
|
661
663
|
A: [
|
|
662
664
|
"this._state === ConnectionState.INITIAL",
|
|
@@ -667,7 +669,7 @@ var Connection = class {
|
|
|
667
669
|
id: this._instanceId
|
|
668
670
|
}), {
|
|
669
671
|
F: __dxlog_file,
|
|
670
|
-
L:
|
|
672
|
+
L: 155,
|
|
671
673
|
S: this,
|
|
672
674
|
C: (f, a) => f(...a)
|
|
673
675
|
});
|
|
@@ -679,7 +681,7 @@ var Connection = class {
|
|
|
679
681
|
initiator: this.initiator
|
|
680
682
|
}, {
|
|
681
683
|
F: __dxlog_file,
|
|
682
|
-
L:
|
|
684
|
+
L: 156,
|
|
683
685
|
S: this,
|
|
684
686
|
C: (f, a) => f(...a)
|
|
685
687
|
});
|
|
@@ -690,15 +692,24 @@ var Connection = class {
|
|
|
690
692
|
this._protocol.stream.on("close", () => {
|
|
691
693
|
(0, import_log.log)("protocol stream closed", void 0, {
|
|
692
694
|
F: __dxlog_file,
|
|
693
|
-
L:
|
|
695
|
+
L: 173,
|
|
694
696
|
S: this,
|
|
695
697
|
C: (f, a) => f(...a)
|
|
696
698
|
});
|
|
697
699
|
this.close(new import_protocols.ProtocolError("protocol stream closed")).catch((err) => this.errors.raise(err));
|
|
698
700
|
});
|
|
701
|
+
(0, import_async.scheduleTask)(this.connectedTimeoutContext, async () => {
|
|
702
|
+
import_log.log.warn("timeout waiting for transport to connect, aborting", void 0, {
|
|
703
|
+
F: __dxlog_file,
|
|
704
|
+
L: 180,
|
|
705
|
+
S: this,
|
|
706
|
+
C: (f, a) => f(...a)
|
|
707
|
+
});
|
|
708
|
+
await this.abort().catch((err) => this.errors.raise(err));
|
|
709
|
+
}, TRANSPORT_CONNECTION_TIMEOUT);
|
|
699
710
|
(0, import_invariant.invariant)(!this._transport, void 0, {
|
|
700
711
|
F: __dxlog_file,
|
|
701
|
-
L:
|
|
712
|
+
L: 186,
|
|
702
713
|
S: this,
|
|
703
714
|
A: [
|
|
704
715
|
"!this._transport",
|
|
@@ -710,26 +721,27 @@ var Connection = class {
|
|
|
710
721
|
stream: this._protocol.stream,
|
|
711
722
|
sendSignal: async (signal) => this._sendSignal(signal)
|
|
712
723
|
});
|
|
713
|
-
this._transport.connected.once(() => {
|
|
724
|
+
this._transport.connected.once(async () => {
|
|
714
725
|
this._changeState(ConnectionState.CONNECTED);
|
|
726
|
+
await this.connectedTimeoutContext.dispose();
|
|
715
727
|
this._callbacks?.onConnected?.();
|
|
716
728
|
});
|
|
717
729
|
this._transport.closed.once(() => {
|
|
718
730
|
this._transport = void 0;
|
|
719
731
|
(0, import_log.log)("abort triggered by transport close", void 0, {
|
|
720
732
|
F: __dxlog_file,
|
|
721
|
-
L:
|
|
733
|
+
L: 201,
|
|
722
734
|
S: this,
|
|
723
735
|
C: (f, a) => f(...a)
|
|
724
736
|
});
|
|
725
737
|
this.abort().catch((err) => this.errors.raise(err));
|
|
726
738
|
});
|
|
727
|
-
this._transport.errors.handle((err) => {
|
|
739
|
+
this._transport.errors.handle(async (err) => {
|
|
728
740
|
(0, import_log.log)("transport error:", {
|
|
729
741
|
err
|
|
730
742
|
}, {
|
|
731
743
|
F: __dxlog_file,
|
|
732
|
-
L:
|
|
744
|
+
L: 206,
|
|
733
745
|
S: this,
|
|
734
746
|
C: (f, a) => f(...a)
|
|
735
747
|
});
|
|
@@ -739,7 +751,7 @@ var Connection = class {
|
|
|
739
751
|
if (err instanceof import_protocols.ConnectionResetError) {
|
|
740
752
|
import_log.log.warn("aborting due to transport ConnectionResetError", void 0, {
|
|
741
753
|
F: __dxlog_file,
|
|
742
|
-
L:
|
|
754
|
+
L: 213,
|
|
743
755
|
S: this,
|
|
744
756
|
C: (f, a) => f(...a)
|
|
745
757
|
});
|
|
@@ -747,7 +759,7 @@ var Connection = class {
|
|
|
747
759
|
} else if (err instanceof import_protocols.ConnectivityError) {
|
|
748
760
|
import_log.log.warn("aborting due to transport ConnectivityError", void 0, {
|
|
749
761
|
F: __dxlog_file,
|
|
750
|
-
L:
|
|
762
|
+
L: 216,
|
|
751
763
|
S: this,
|
|
752
764
|
C: (f, a) => f(...a)
|
|
753
765
|
});
|
|
@@ -757,12 +769,13 @@ var Connection = class {
|
|
|
757
769
|
err
|
|
758
770
|
}, {
|
|
759
771
|
F: __dxlog_file,
|
|
760
|
-
L:
|
|
772
|
+
L: 219,
|
|
761
773
|
S: this,
|
|
762
774
|
C: (f, a) => f(...a)
|
|
763
775
|
});
|
|
764
776
|
}
|
|
765
777
|
if (this._state !== ConnectionState.CLOSED && this._state !== ConnectionState.CLOSING) {
|
|
778
|
+
await this.connectedTimeoutContext.dispose();
|
|
766
779
|
this.errors.raise(err);
|
|
767
780
|
}
|
|
768
781
|
});
|
|
@@ -774,7 +787,7 @@ var Connection = class {
|
|
|
774
787
|
id: this._instanceId
|
|
775
788
|
}), {
|
|
776
789
|
F: __dxlog_file,
|
|
777
|
-
L:
|
|
790
|
+
L: 235,
|
|
778
791
|
S: this,
|
|
779
792
|
C: (f, a) => f(...a)
|
|
780
793
|
});
|
|
@@ -784,30 +797,29 @@ var Connection = class {
|
|
|
784
797
|
err
|
|
785
798
|
}, {
|
|
786
799
|
F: __dxlog_file,
|
|
787
|
-
L:
|
|
800
|
+
L: 242,
|
|
788
801
|
S: this,
|
|
789
802
|
C: (f, a) => f(...a)
|
|
790
803
|
});
|
|
791
804
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTED) {
|
|
792
805
|
(0, import_log.log)(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
793
806
|
F: __dxlog_file,
|
|
794
|
-
L:
|
|
807
|
+
L: 244,
|
|
795
808
|
S: this,
|
|
796
809
|
C: (f, a) => f(...a)
|
|
797
810
|
});
|
|
798
811
|
return;
|
|
799
812
|
}
|
|
813
|
+
await this.connectedTimeoutContext.dispose();
|
|
800
814
|
this._changeState(ConnectionState.ABORTING);
|
|
801
815
|
if (!this.closeReason) {
|
|
802
816
|
this.closeReason = err?.message;
|
|
803
817
|
}
|
|
804
818
|
await this._ctx.dispose();
|
|
805
819
|
try {
|
|
806
|
-
(0, import_log.log)("aborting protocol... ", {
|
|
807
|
-
proto: this._protocol
|
|
808
|
-
}, {
|
|
820
|
+
(0, import_log.log)("aborting protocol... ", void 0, {
|
|
809
821
|
F: __dxlog_file,
|
|
810
|
-
L:
|
|
822
|
+
L: 258,
|
|
811
823
|
S: this,
|
|
812
824
|
C: (f, a) => f(...a)
|
|
813
825
|
});
|
|
@@ -815,7 +827,7 @@ var Connection = class {
|
|
|
815
827
|
} catch (err2) {
|
|
816
828
|
import_log.log.catch(err2, void 0, {
|
|
817
829
|
F: __dxlog_file,
|
|
818
|
-
L:
|
|
830
|
+
L: 261,
|
|
819
831
|
S: this,
|
|
820
832
|
C: (f, a) => f(...a)
|
|
821
833
|
});
|
|
@@ -825,7 +837,7 @@ var Connection = class {
|
|
|
825
837
|
} catch (err2) {
|
|
826
838
|
import_log.log.catch(err2, void 0, {
|
|
827
839
|
F: __dxlog_file,
|
|
828
|
-
L:
|
|
840
|
+
L: 268,
|
|
829
841
|
S: this,
|
|
830
842
|
C: (f, a) => f(...a)
|
|
831
843
|
});
|
|
@@ -835,7 +847,7 @@ var Connection = class {
|
|
|
835
847
|
} catch (err2) {
|
|
836
848
|
import_log.log.catch(err2, void 0, {
|
|
837
849
|
F: __dxlog_file,
|
|
838
|
-
L:
|
|
850
|
+
L: 274,
|
|
839
851
|
S: this,
|
|
840
852
|
C: (f, a) => f(...a)
|
|
841
853
|
});
|
|
@@ -845,18 +857,21 @@ var Connection = class {
|
|
|
845
857
|
async close(err) {
|
|
846
858
|
if (!this.closeReason) {
|
|
847
859
|
this.closeReason = err?.message;
|
|
860
|
+
} else {
|
|
861
|
+
this.closeReason += `; ${err?.message}`;
|
|
848
862
|
}
|
|
849
863
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTING || this._state === ConnectionState.ABORTED) {
|
|
850
864
|
return;
|
|
851
865
|
}
|
|
852
866
|
const lastState = this._state;
|
|
853
867
|
this._changeState(ConnectionState.CLOSING);
|
|
868
|
+
await this.connectedTimeoutContext.dispose();
|
|
854
869
|
await this._ctx.dispose();
|
|
855
870
|
(0, import_log.log)("closing...", {
|
|
856
871
|
peerId: this.ownId
|
|
857
872
|
}, {
|
|
858
873
|
F: __dxlog_file,
|
|
859
|
-
L:
|
|
874
|
+
L: 299,
|
|
860
875
|
S: this,
|
|
861
876
|
C: (f, a) => f(...a)
|
|
862
877
|
});
|
|
@@ -866,7 +881,7 @@ var Connection = class {
|
|
|
866
881
|
} catch (err2) {
|
|
867
882
|
import_log.log.catch(err2, void 0, {
|
|
868
883
|
F: __dxlog_file,
|
|
869
|
-
L:
|
|
884
|
+
L: 306,
|
|
870
885
|
S: this,
|
|
871
886
|
C: (f, a) => f(...a)
|
|
872
887
|
});
|
|
@@ -876,7 +891,7 @@ var Connection = class {
|
|
|
876
891
|
} catch (err2) {
|
|
877
892
|
import_log.log.catch(err2, void 0, {
|
|
878
893
|
F: __dxlog_file,
|
|
879
|
-
L:
|
|
894
|
+
L: 313,
|
|
880
895
|
S: this,
|
|
881
896
|
C: (f, a) => f(...a)
|
|
882
897
|
});
|
|
@@ -886,7 +901,7 @@ var Connection = class {
|
|
|
886
901
|
peerId: this.ownId
|
|
887
902
|
}, {
|
|
888
903
|
F: __dxlog_file,
|
|
889
|
-
L:
|
|
904
|
+
L: 317,
|
|
890
905
|
S: this,
|
|
891
906
|
C: (f, a) => f(...a)
|
|
892
907
|
});
|
|
@@ -922,14 +937,14 @@ var Connection = class {
|
|
|
922
937
|
}
|
|
923
938
|
});
|
|
924
939
|
} catch (err) {
|
|
925
|
-
if (err instanceof import_protocols.CancelledError) {
|
|
940
|
+
if (err instanceof import_protocols.CancelledError || err instanceof Error && err.message?.includes("CANCELLED")) {
|
|
926
941
|
return;
|
|
927
942
|
}
|
|
928
943
|
import_log.log.warn("signal failed", {
|
|
929
944
|
err
|
|
930
945
|
}, {
|
|
931
946
|
F: __dxlog_file,
|
|
932
|
-
L:
|
|
947
|
+
L: 355,
|
|
933
948
|
S: this,
|
|
934
949
|
C: (f, a) => f(...a)
|
|
935
950
|
});
|
|
@@ -942,7 +957,7 @@ var Connection = class {
|
|
|
942
957
|
async signal(msg) {
|
|
943
958
|
(0, import_invariant.invariant)(msg.sessionId, void 0, {
|
|
944
959
|
F: __dxlog_file,
|
|
945
|
-
L:
|
|
960
|
+
L: 364,
|
|
946
961
|
S: this,
|
|
947
962
|
A: [
|
|
948
963
|
"msg.sessionId",
|
|
@@ -952,7 +967,7 @@ var Connection = class {
|
|
|
952
967
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
953
968
|
(0, import_log.log)("dropping signal for incorrect session id", void 0, {
|
|
954
969
|
F: __dxlog_file,
|
|
955
|
-
L:
|
|
970
|
+
L: 366,
|
|
956
971
|
S: this,
|
|
957
972
|
C: (f, a) => f(...a)
|
|
958
973
|
});
|
|
@@ -960,7 +975,7 @@ var Connection = class {
|
|
|
960
975
|
}
|
|
961
976
|
(0, import_invariant.invariant)(msg.data.signal || msg.data.signalBatch, void 0, {
|
|
962
977
|
F: __dxlog_file,
|
|
963
|
-
L:
|
|
978
|
+
L: 369,
|
|
964
979
|
S: this,
|
|
965
980
|
A: [
|
|
966
981
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -969,7 +984,7 @@ var Connection = class {
|
|
|
969
984
|
});
|
|
970
985
|
(0, import_invariant.invariant)(msg.author?.equals(this.remoteId), void 0, {
|
|
971
986
|
F: __dxlog_file,
|
|
972
|
-
L:
|
|
987
|
+
L: 370,
|
|
973
988
|
S: this,
|
|
974
989
|
A: [
|
|
975
990
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -978,7 +993,7 @@ var Connection = class {
|
|
|
978
993
|
});
|
|
979
994
|
(0, import_invariant.invariant)(msg.recipient?.equals(this.ownId), void 0, {
|
|
980
995
|
F: __dxlog_file,
|
|
981
|
-
L:
|
|
996
|
+
L: 371,
|
|
982
997
|
S: this,
|
|
983
998
|
A: [
|
|
984
999
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -1002,7 +1017,7 @@ var Connection = class {
|
|
|
1002
1017
|
msg: msg.data
|
|
1003
1018
|
}, {
|
|
1004
1019
|
F: __dxlog_file,
|
|
1005
|
-
L:
|
|
1020
|
+
L: 380,
|
|
1006
1021
|
S: this,
|
|
1007
1022
|
C: (f, a) => f(...a)
|
|
1008
1023
|
});
|
|
@@ -1010,7 +1025,7 @@ var Connection = class {
|
|
|
1010
1025
|
} else {
|
|
1011
1026
|
(0, import_invariant.invariant)(this._transport, "Connection not ready to accept signals.", {
|
|
1012
1027
|
F: __dxlog_file,
|
|
1013
|
-
L:
|
|
1028
|
+
L: 383,
|
|
1014
1029
|
S: this,
|
|
1015
1030
|
A: [
|
|
1016
1031
|
"this._transport",
|
|
@@ -1023,7 +1038,7 @@ var Connection = class {
|
|
|
1023
1038
|
msg: msg.data
|
|
1024
1039
|
}, {
|
|
1025
1040
|
F: __dxlog_file,
|
|
1026
|
-
L:
|
|
1041
|
+
L: 384,
|
|
1027
1042
|
S: this,
|
|
1028
1043
|
C: (f, a) => f(...a)
|
|
1029
1044
|
});
|
|
@@ -1041,13 +1056,13 @@ var Connection = class {
|
|
|
1041
1056
|
peerId: this.ownId
|
|
1042
1057
|
}, {
|
|
1043
1058
|
F: __dxlog_file,
|
|
1044
|
-
L:
|
|
1059
|
+
L: 395,
|
|
1045
1060
|
S: this,
|
|
1046
1061
|
C: (f, a) => f(...a)
|
|
1047
1062
|
});
|
|
1048
1063
|
(0, import_invariant.invariant)(state !== this._state, "Already in this state.", {
|
|
1049
1064
|
F: __dxlog_file,
|
|
1050
|
-
L:
|
|
1065
|
+
L: 396,
|
|
1051
1066
|
S: this,
|
|
1052
1067
|
A: [
|
|
1053
1068
|
"state !== this._state",
|
|
@@ -1092,7 +1107,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
1092
1107
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1093
1108
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1094
1109
|
}
|
|
1095
|
-
var __dxlog_file2 = "/
|
|
1110
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/peer.ts";
|
|
1096
1111
|
var ConnectionDisplacedError = class extends import_protocols2.SystemError {
|
|
1097
1112
|
constructor() {
|
|
1098
1113
|
super("Connection displaced by remote initiator.");
|
|
@@ -1124,11 +1139,12 @@ var Peer = class {
|
|
|
1124
1139
|
const remoteId = message.author;
|
|
1125
1140
|
if (this.connection && ![
|
|
1126
1141
|
ConnectionState.CREATED,
|
|
1127
|
-
ConnectionState.INITIAL
|
|
1142
|
+
ConnectionState.INITIAL,
|
|
1143
|
+
ConnectionState.CONNECTING
|
|
1128
1144
|
].includes(this.connection.state)) {
|
|
1129
1145
|
import_log2.log.info(`received offer when connection already in ${this.connection.state} state`, void 0, {
|
|
1130
1146
|
F: __dxlog_file2,
|
|
1131
|
-
L:
|
|
1147
|
+
L: 115,
|
|
1132
1148
|
S: this,
|
|
1133
1149
|
C: (f, a) => f(...a)
|
|
1134
1150
|
});
|
|
@@ -1145,7 +1161,7 @@ var Peer = class {
|
|
|
1145
1161
|
sessionId: this.connection?.sessionId
|
|
1146
1162
|
}, {
|
|
1147
1163
|
F: __dxlog_file2,
|
|
1148
|
-
L:
|
|
1164
|
+
L: 124,
|
|
1149
1165
|
S: this,
|
|
1150
1166
|
C: (f, a) => f(...a)
|
|
1151
1167
|
});
|
|
@@ -1162,7 +1178,7 @@ var Peer = class {
|
|
|
1162
1178
|
if (!this.connection) {
|
|
1163
1179
|
(0, import_invariant2.invariant)(message.sessionId, void 0, {
|
|
1164
1180
|
F: __dxlog_file2,
|
|
1165
|
-
L:
|
|
1181
|
+
L: 144,
|
|
1166
1182
|
S: this,
|
|
1167
1183
|
A: [
|
|
1168
1184
|
"message.sessionId",
|
|
@@ -1183,7 +1199,7 @@ var Peer = class {
|
|
|
1183
1199
|
err
|
|
1184
1200
|
}, {
|
|
1185
1201
|
F: __dxlog_file2,
|
|
1186
|
-
L:
|
|
1202
|
+
L: 154,
|
|
1187
1203
|
S: this,
|
|
1188
1204
|
C: (f, a) => f(...a)
|
|
1189
1205
|
});
|
|
@@ -1205,7 +1221,7 @@ var Peer = class {
|
|
|
1205
1221
|
async initiateConnection() {
|
|
1206
1222
|
(0, import_invariant2.invariant)(!this.initiating, "Initiation in progress.", {
|
|
1207
1223
|
F: __dxlog_file2,
|
|
1208
|
-
L:
|
|
1224
|
+
L: 171,
|
|
1209
1225
|
S: this,
|
|
1210
1226
|
A: [
|
|
1211
1227
|
"!this.initiating",
|
|
@@ -1214,7 +1230,7 @@ var Peer = class {
|
|
|
1214
1230
|
});
|
|
1215
1231
|
(0, import_invariant2.invariant)(!this.connection, "Already connected.", {
|
|
1216
1232
|
F: __dxlog_file2,
|
|
1217
|
-
L:
|
|
1233
|
+
L: 172,
|
|
1218
1234
|
S: this,
|
|
1219
1235
|
A: [
|
|
1220
1236
|
"!this.connection",
|
|
@@ -1229,16 +1245,17 @@ var Peer = class {
|
|
|
1229
1245
|
sessionId
|
|
1230
1246
|
}, {
|
|
1231
1247
|
F: __dxlog_file2,
|
|
1232
|
-
L:
|
|
1248
|
+
L: 174,
|
|
1233
1249
|
S: this,
|
|
1234
1250
|
C: (f, a) => f(...a)
|
|
1235
1251
|
});
|
|
1236
1252
|
const connection = this._createConnection(true, sessionId);
|
|
1237
1253
|
this.initiating = true;
|
|
1254
|
+
let answer;
|
|
1238
1255
|
try {
|
|
1239
1256
|
await this._connectionLimiter.connecting(sessionId);
|
|
1240
1257
|
connection.initiate();
|
|
1241
|
-
|
|
1258
|
+
answer = await this._signalMessaging.offer({
|
|
1242
1259
|
author: this.localPeerId,
|
|
1243
1260
|
recipient: this.id,
|
|
1244
1261
|
sessionId,
|
|
@@ -1254,46 +1271,87 @@ var Peer = class {
|
|
|
1254
1271
|
remoteId: this.id
|
|
1255
1272
|
}, {
|
|
1256
1273
|
F: __dxlog_file2,
|
|
1257
|
-
L:
|
|
1274
|
+
L: 191,
|
|
1258
1275
|
S: this,
|
|
1259
1276
|
C: (f, a) => f(...a)
|
|
1260
1277
|
});
|
|
1261
1278
|
if (connection.state !== ConnectionState.INITIAL) {
|
|
1262
1279
|
(0, import_log2.log)("ignoring response", void 0, {
|
|
1263
1280
|
F: __dxlog_file2,
|
|
1264
|
-
L:
|
|
1281
|
+
L: 193,
|
|
1265
1282
|
S: this,
|
|
1266
1283
|
C: (f, a) => f(...a)
|
|
1267
1284
|
});
|
|
1268
1285
|
return;
|
|
1269
1286
|
}
|
|
1287
|
+
} catch (err) {
|
|
1288
|
+
(0, import_log2.log)("initiation error: send offer", {
|
|
1289
|
+
err,
|
|
1290
|
+
topic: this.topic,
|
|
1291
|
+
peerId: this.localPeerId,
|
|
1292
|
+
remoteId: this.id
|
|
1293
|
+
}, {
|
|
1294
|
+
F: __dxlog_file2,
|
|
1295
|
+
L: 197,
|
|
1296
|
+
S: this,
|
|
1297
|
+
C: (f, a) => f(...a)
|
|
1298
|
+
});
|
|
1299
|
+
await connection.abort(err);
|
|
1300
|
+
throw err;
|
|
1301
|
+
} finally {
|
|
1302
|
+
this.initiating = false;
|
|
1303
|
+
}
|
|
1304
|
+
try {
|
|
1270
1305
|
if (!answer.accept) {
|
|
1271
1306
|
this._callbacks.onRejected();
|
|
1272
1307
|
return;
|
|
1273
1308
|
}
|
|
1309
|
+
} catch (err) {
|
|
1310
|
+
(0, import_log2.log)("initiation error: accept answer", {
|
|
1311
|
+
err,
|
|
1312
|
+
topic: this.topic,
|
|
1313
|
+
peerId: this.localPeerId,
|
|
1314
|
+
remoteId: this.id
|
|
1315
|
+
}, {
|
|
1316
|
+
F: __dxlog_file2,
|
|
1317
|
+
L: 210,
|
|
1318
|
+
S: this,
|
|
1319
|
+
C: (f, a) => f(...a)
|
|
1320
|
+
});
|
|
1321
|
+
await connection.abort(err);
|
|
1322
|
+
throw err;
|
|
1323
|
+
} finally {
|
|
1324
|
+
this.initiating = false;
|
|
1325
|
+
}
|
|
1326
|
+
try {
|
|
1327
|
+
(0, import_log2.log)("opening connection as initiator", void 0, {
|
|
1328
|
+
F: __dxlog_file2,
|
|
1329
|
+
L: 223,
|
|
1330
|
+
S: this,
|
|
1331
|
+
C: (f, a) => f(...a)
|
|
1332
|
+
});
|
|
1274
1333
|
await connection.openConnection();
|
|
1275
1334
|
this._callbacks.onAccepted();
|
|
1276
1335
|
} catch (err) {
|
|
1277
|
-
(0, import_log2.log)("initiation error", {
|
|
1336
|
+
(0, import_log2.log)("initiation error: open connection", {
|
|
1278
1337
|
err,
|
|
1279
1338
|
topic: this.topic,
|
|
1280
1339
|
peerId: this.localPeerId,
|
|
1281
1340
|
remoteId: this.id
|
|
1282
1341
|
}, {
|
|
1283
1342
|
F: __dxlog_file2,
|
|
1284
|
-
L:
|
|
1343
|
+
L: 227,
|
|
1344
|
+
S: this,
|
|
1345
|
+
C: (f, a) => f(...a)
|
|
1346
|
+
});
|
|
1347
|
+
import_log2.log.warn("closing connection due to unhandled error on openConnection", {
|
|
1348
|
+
err
|
|
1349
|
+
}, {
|
|
1350
|
+
F: __dxlog_file2,
|
|
1351
|
+
L: 234,
|
|
1285
1352
|
S: this,
|
|
1286
1353
|
C: (f, a) => f(...a)
|
|
1287
1354
|
});
|
|
1288
|
-
if (err instanceof import_protocols2.TimeoutError) {
|
|
1289
|
-
import_log2.log.warn("aborting connection due to signalling failure", void 0, {
|
|
1290
|
-
F: __dxlog_file2,
|
|
1291
|
-
L: 202,
|
|
1292
|
-
S: this,
|
|
1293
|
-
C: (f, a) => f(...a)
|
|
1294
|
-
});
|
|
1295
|
-
await connection.abort(err);
|
|
1296
|
-
}
|
|
1297
1355
|
await this.closeConnection(err);
|
|
1298
1356
|
throw err;
|
|
1299
1357
|
} finally {
|
|
@@ -1313,13 +1371,13 @@ var Peer = class {
|
|
|
1313
1371
|
sessionId
|
|
1314
1372
|
}, {
|
|
1315
1373
|
F: __dxlog_file2,
|
|
1316
|
-
L:
|
|
1374
|
+
L: 248,
|
|
1317
1375
|
S: this,
|
|
1318
1376
|
C: (f, a) => f(...a)
|
|
1319
1377
|
});
|
|
1320
1378
|
(0, import_invariant2.invariant)(!this.connection, "Already connected.", {
|
|
1321
1379
|
F: __dxlog_file2,
|
|
1322
|
-
L:
|
|
1380
|
+
L: 255,
|
|
1323
1381
|
S: this,
|
|
1324
1382
|
A: [
|
|
1325
1383
|
"!this.connection",
|
|
@@ -1355,7 +1413,7 @@ var Peer = class {
|
|
|
1355
1413
|
initiator
|
|
1356
1414
|
}, {
|
|
1357
1415
|
F: __dxlog_file2,
|
|
1358
|
-
L:
|
|
1416
|
+
L: 274,
|
|
1359
1417
|
S: this,
|
|
1360
1418
|
C: (f, a) => f(...a)
|
|
1361
1419
|
});
|
|
@@ -1368,14 +1426,14 @@ var Peer = class {
|
|
|
1368
1426
|
initiator
|
|
1369
1427
|
}, {
|
|
1370
1428
|
F: __dxlog_file2,
|
|
1371
|
-
L:
|
|
1429
|
+
L: 283,
|
|
1372
1430
|
S: this,
|
|
1373
1431
|
C: (f, a) => f(...a)
|
|
1374
1432
|
});
|
|
1375
1433
|
this._connectionLimiter.doneConnecting(sessionId);
|
|
1376
1434
|
(0, import_invariant2.invariant)(this.connection === connection, "Connection mismatch (race condition).", {
|
|
1377
1435
|
F: __dxlog_file2,
|
|
1378
|
-
L:
|
|
1436
|
+
L: 288,
|
|
1379
1437
|
S: this,
|
|
1380
1438
|
A: [
|
|
1381
1439
|
"this.connection === connection",
|
|
@@ -1390,7 +1448,7 @@ var Peer = class {
|
|
|
1390
1448
|
initiator
|
|
1391
1449
|
}, {
|
|
1392
1450
|
F: __dxlog_file2,
|
|
1393
|
-
L:
|
|
1451
|
+
L: 290,
|
|
1394
1452
|
S: this,
|
|
1395
1453
|
C: (f, a) => f(...a)
|
|
1396
1454
|
});
|
|
@@ -1417,7 +1475,7 @@ var Peer = class {
|
|
|
1417
1475
|
void this._connectionCtx?.dispose();
|
|
1418
1476
|
this._connectionCtx = this._ctx.derive();
|
|
1419
1477
|
connection.errors.handle((err) => {
|
|
1420
|
-
import_log2.log.warn("connection error", {
|
|
1478
|
+
import_log2.log.warn("connection error, closing", {
|
|
1421
1479
|
topic: this.topic,
|
|
1422
1480
|
peerId: this.localPeerId,
|
|
1423
1481
|
remoteId: this.id,
|
|
@@ -1425,7 +1483,7 @@ var Peer = class {
|
|
|
1425
1483
|
err
|
|
1426
1484
|
}, {
|
|
1427
1485
|
F: __dxlog_file2,
|
|
1428
|
-
L:
|
|
1486
|
+
L: 330,
|
|
1429
1487
|
S: this,
|
|
1430
1488
|
C: (f, a) => f(...a)
|
|
1431
1489
|
});
|
|
@@ -1438,7 +1496,7 @@ var Peer = class {
|
|
|
1438
1496
|
err
|
|
1439
1497
|
}, {
|
|
1440
1498
|
F: __dxlog_file2,
|
|
1441
|
-
L:
|
|
1499
|
+
L: 337,
|
|
1442
1500
|
S: this,
|
|
1443
1501
|
C: (f, a) => f(...a)
|
|
1444
1502
|
});
|
|
@@ -1457,7 +1515,7 @@ var Peer = class {
|
|
|
1457
1515
|
sessionId: connection.sessionId
|
|
1458
1516
|
}, {
|
|
1459
1517
|
F: __dxlog_file2,
|
|
1460
|
-
L:
|
|
1518
|
+
L: 362,
|
|
1461
1519
|
S: this,
|
|
1462
1520
|
C: (f, a) => f(...a)
|
|
1463
1521
|
});
|
|
@@ -1467,7 +1525,7 @@ var Peer = class {
|
|
|
1467
1525
|
sessionId: connection.sessionId
|
|
1468
1526
|
}, {
|
|
1469
1527
|
F: __dxlog_file2,
|
|
1470
|
-
L:
|
|
1528
|
+
L: 368,
|
|
1471
1529
|
S: this,
|
|
1472
1530
|
C: (f, a) => f(...a)
|
|
1473
1531
|
});
|
|
@@ -1478,7 +1536,7 @@ var Peer = class {
|
|
|
1478
1536
|
message
|
|
1479
1537
|
}, {
|
|
1480
1538
|
F: __dxlog_file2,
|
|
1481
|
-
L:
|
|
1539
|
+
L: 373,
|
|
1482
1540
|
S: this,
|
|
1483
1541
|
C: (f, a) => f(...a)
|
|
1484
1542
|
});
|
|
@@ -1486,18 +1544,18 @@ var Peer = class {
|
|
|
1486
1544
|
}
|
|
1487
1545
|
await this.connection.signal(message);
|
|
1488
1546
|
}
|
|
1489
|
-
async destroy() {
|
|
1547
|
+
async destroy(reason) {
|
|
1490
1548
|
await this._ctx.dispose();
|
|
1491
1549
|
(0, import_log2.log)("Destroying peer", {
|
|
1492
1550
|
peerId: this.id,
|
|
1493
1551
|
topic: this.topic
|
|
1494
1552
|
}, {
|
|
1495
1553
|
F: __dxlog_file2,
|
|
1496
|
-
L:
|
|
1554
|
+
L: 383,
|
|
1497
1555
|
S: this,
|
|
1498
1556
|
C: (f, a) => f(...a)
|
|
1499
1557
|
});
|
|
1500
|
-
await this?.connection?.close();
|
|
1558
|
+
await this?.connection?.close(reason);
|
|
1501
1559
|
}
|
|
1502
1560
|
};
|
|
1503
1561
|
_ts_decorate2([
|
|
@@ -1523,7 +1581,7 @@ var import_keys3 = require("@dxos/keys");
|
|
|
1523
1581
|
var import_log3 = require("@dxos/log");
|
|
1524
1582
|
var import_protocols3 = require("@dxos/protocols");
|
|
1525
1583
|
var import_util = require("@dxos/util");
|
|
1526
|
-
var __dxlog_file3 = "/
|
|
1584
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/signal/swarm-messenger.ts";
|
|
1527
1585
|
var SwarmMessage = import_protocols3.schema.getCodecForType("dxos.mesh.swarm.SwarmMessage");
|
|
1528
1586
|
var SwarmMessenger = class {
|
|
1529
1587
|
constructor({ sendMessage, onSignal, onOffer, topic }) {
|
|
@@ -1759,7 +1817,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
1759
1817
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1760
1818
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1761
1819
|
}
|
|
1762
|
-
var __dxlog_file4 = "/
|
|
1820
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm.ts";
|
|
1763
1821
|
var INITIATION_DELAY = 100;
|
|
1764
1822
|
var getClassName = (obj) => Object.getPrototypeOf(obj).constructor.name;
|
|
1765
1823
|
var Swarm = class {
|
|
@@ -1870,7 +1928,7 @@ var Swarm = class {
|
|
|
1870
1928
|
this._listeningHandle = void 0;
|
|
1871
1929
|
await this._ctx.dispose();
|
|
1872
1930
|
await this._topology.destroy();
|
|
1873
|
-
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key)));
|
|
1931
|
+
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key, "swarm destroyed")));
|
|
1874
1932
|
(0, import_log4.log)("destroyed", void 0, {
|
|
1875
1933
|
F: __dxlog_file4,
|
|
1876
1934
|
L: 148,
|
|
@@ -1942,13 +2000,22 @@ var Swarm = class {
|
|
|
1942
2000
|
if (peer) {
|
|
1943
2001
|
peer.advertizing = false;
|
|
1944
2002
|
if (peer.connection?.state !== ConnectionState.CONNECTED) {
|
|
1945
|
-
void this._destroyPeer(peer.id).catch((err) => import_log4.log.catch(err, void 0, {
|
|
2003
|
+
void this._destroyPeer(peer.id, "peer left").catch((err) => import_log4.log.catch(err, void 0, {
|
|
1946
2004
|
F: __dxlog_file4,
|
|
1947
2005
|
L: 189,
|
|
1948
2006
|
S: this,
|
|
1949
2007
|
C: (f, a) => f(...a)
|
|
1950
2008
|
}));
|
|
1951
2009
|
}
|
|
2010
|
+
} else {
|
|
2011
|
+
(0, import_log4.log)("received peerLeft but no peer found", {
|
|
2012
|
+
peer: swarmEvent.peerLeft.peer
|
|
2013
|
+
}, {
|
|
2014
|
+
F: __dxlog_file4,
|
|
2015
|
+
L: 192,
|
|
2016
|
+
S: this,
|
|
2017
|
+
C: (f, a) => f(...a)
|
|
2018
|
+
});
|
|
1952
2019
|
}
|
|
1953
2020
|
}
|
|
1954
2021
|
this._topology.update();
|
|
@@ -1958,14 +2025,14 @@ var Swarm = class {
|
|
|
1958
2025
|
message
|
|
1959
2026
|
}, {
|
|
1960
2027
|
F: __dxlog_file4,
|
|
1961
|
-
L:
|
|
2028
|
+
L: 201,
|
|
1962
2029
|
S: this,
|
|
1963
2030
|
C: (f, a) => f(...a)
|
|
1964
2031
|
});
|
|
1965
2032
|
if (this._ctx.disposed) {
|
|
1966
2033
|
(0, import_log4.log)("ignored for disposed swarm", void 0, {
|
|
1967
2034
|
F: __dxlog_file4,
|
|
1968
|
-
L:
|
|
2035
|
+
L: 203,
|
|
1969
2036
|
S: this,
|
|
1970
2037
|
C: (f, a) => f(...a)
|
|
1971
2038
|
});
|
|
@@ -1975,7 +2042,7 @@ var Swarm = class {
|
|
|
1975
2042
|
}
|
|
1976
2043
|
(0, import_invariant4.invariant)(message.author, void 0, {
|
|
1977
2044
|
F: __dxlog_file4,
|
|
1978
|
-
L:
|
|
2045
|
+
L: 208,
|
|
1979
2046
|
S: this,
|
|
1980
2047
|
A: [
|
|
1981
2048
|
"message.author",
|
|
@@ -1987,7 +2054,7 @@ var Swarm = class {
|
|
|
1987
2054
|
message
|
|
1988
2055
|
}, {
|
|
1989
2056
|
F: __dxlog_file4,
|
|
1990
|
-
L:
|
|
2057
|
+
L: 210,
|
|
1991
2058
|
S: this,
|
|
1992
2059
|
C: (f, a) => f(...a)
|
|
1993
2060
|
});
|
|
@@ -2000,7 +2067,7 @@ var Swarm = class {
|
|
|
2000
2067
|
message
|
|
2001
2068
|
}, {
|
|
2002
2069
|
F: __dxlog_file4,
|
|
2003
|
-
L:
|
|
2070
|
+
L: 214,
|
|
2004
2071
|
S: this,
|
|
2005
2072
|
C: (f, a) => f(...a)
|
|
2006
2073
|
});
|
|
@@ -2018,14 +2085,14 @@ var Swarm = class {
|
|
|
2018
2085
|
message
|
|
2019
2086
|
}, {
|
|
2020
2087
|
F: __dxlog_file4,
|
|
2021
|
-
L:
|
|
2088
|
+
L: 225,
|
|
2022
2089
|
S: this,
|
|
2023
2090
|
C: (f, a) => f(...a)
|
|
2024
2091
|
});
|
|
2025
2092
|
if (this._ctx.disposed) {
|
|
2026
2093
|
import_log4.log.info("ignored for offline swarm", void 0, {
|
|
2027
2094
|
F: __dxlog_file4,
|
|
2028
|
-
L:
|
|
2095
|
+
L: 227,
|
|
2029
2096
|
S: this,
|
|
2030
2097
|
C: (f, a) => f(...a)
|
|
2031
2098
|
});
|
|
@@ -2033,7 +2100,7 @@ var Swarm = class {
|
|
|
2033
2100
|
}
|
|
2034
2101
|
(0, import_invariant4.invariant)(message.recipient?.equals(this._ownPeerId), `Invalid signal peer id expected=${this.ownPeerId}, actual=${message.recipient}`, {
|
|
2035
2102
|
F: __dxlog_file4,
|
|
2036
|
-
L:
|
|
2103
|
+
L: 230,
|
|
2037
2104
|
S: this,
|
|
2038
2105
|
A: [
|
|
2039
2106
|
"message.recipient?.equals(this._ownPeerId)",
|
|
@@ -2042,7 +2109,7 @@ var Swarm = class {
|
|
|
2042
2109
|
});
|
|
2043
2110
|
(0, import_invariant4.invariant)(message.topic?.equals(this._topic), void 0, {
|
|
2044
2111
|
F: __dxlog_file4,
|
|
2045
|
-
L:
|
|
2112
|
+
L: 234,
|
|
2046
2113
|
S: this,
|
|
2047
2114
|
A: [
|
|
2048
2115
|
"message.topic?.equals(this._topic)",
|
|
@@ -2051,7 +2118,7 @@ var Swarm = class {
|
|
|
2051
2118
|
});
|
|
2052
2119
|
(0, import_invariant4.invariant)(message.author, void 0, {
|
|
2053
2120
|
F: __dxlog_file4,
|
|
2054
|
-
L:
|
|
2121
|
+
L: 235,
|
|
2055
2122
|
S: this,
|
|
2056
2123
|
A: [
|
|
2057
2124
|
"message.author",
|
|
@@ -2066,7 +2133,7 @@ var Swarm = class {
|
|
|
2066
2133
|
await this._ctx.dispose();
|
|
2067
2134
|
await Promise.all([
|
|
2068
2135
|
...this._peers.keys()
|
|
2069
|
-
].map((peerId) => this._destroyPeer(peerId)));
|
|
2136
|
+
].map((peerId) => this._destroyPeer(peerId, "goOffline")));
|
|
2070
2137
|
}
|
|
2071
2138
|
// For debug purposes
|
|
2072
2139
|
async goOnline() {
|
|
@@ -2084,14 +2151,22 @@ var Swarm = class {
|
|
|
2084
2151
|
},
|
|
2085
2152
|
onDisconnected: async () => {
|
|
2086
2153
|
if (!peer.advertizing) {
|
|
2087
|
-
await this._destroyPeer(peer.id);
|
|
2154
|
+
await this._destroyPeer(peer.id, "peer disconnected");
|
|
2088
2155
|
}
|
|
2089
2156
|
this.disconnected.emit(peerId);
|
|
2090
2157
|
this._topology.update();
|
|
2091
2158
|
},
|
|
2092
2159
|
onRejected: () => {
|
|
2093
2160
|
if (this._peers.has(peerId)) {
|
|
2094
|
-
|
|
2161
|
+
(0, import_log4.log)("peer rejected connection", {
|
|
2162
|
+
peerId
|
|
2163
|
+
}, {
|
|
2164
|
+
F: __dxlog_file4,
|
|
2165
|
+
L: 284,
|
|
2166
|
+
S: this,
|
|
2167
|
+
C: (f, a) => f(...a)
|
|
2168
|
+
});
|
|
2169
|
+
void this._destroyPeer(peerId, "peer rejected connection");
|
|
2095
2170
|
}
|
|
2096
2171
|
},
|
|
2097
2172
|
onAccepted: () => {
|
|
@@ -2108,17 +2183,17 @@ var Swarm = class {
|
|
|
2108
2183
|
}
|
|
2109
2184
|
return peer;
|
|
2110
2185
|
}
|
|
2111
|
-
async _destroyPeer(peerId) {
|
|
2186
|
+
async _destroyPeer(peerId, reason) {
|
|
2112
2187
|
(0, import_invariant4.invariant)(this._peers.has(peerId), void 0, {
|
|
2113
2188
|
F: __dxlog_file4,
|
|
2114
|
-
L:
|
|
2189
|
+
L: 306,
|
|
2115
2190
|
S: this,
|
|
2116
2191
|
A: [
|
|
2117
2192
|
"this._peers.has(peerId)",
|
|
2118
2193
|
""
|
|
2119
2194
|
]
|
|
2120
2195
|
});
|
|
2121
|
-
await this._peers.get(peerId).destroy();
|
|
2196
|
+
await this._peers.get(peerId).destroy(new Error(reason));
|
|
2122
2197
|
this._peers.delete(peerId);
|
|
2123
2198
|
}
|
|
2124
2199
|
_getSwarmController() {
|
|
@@ -2138,7 +2213,7 @@ var Swarm = class {
|
|
|
2138
2213
|
} catch (err) {
|
|
2139
2214
|
(0, import_log4.log)("initiation error", err, {
|
|
2140
2215
|
F: __dxlog_file4,
|
|
2141
|
-
L:
|
|
2216
|
+
L: 332,
|
|
2142
2217
|
S: this,
|
|
2143
2218
|
C: (f, a) => f(...a)
|
|
2144
2219
|
});
|
|
@@ -2166,7 +2241,7 @@ var Swarm = class {
|
|
|
2166
2241
|
remoteId
|
|
2167
2242
|
}, {
|
|
2168
2243
|
F: __dxlog_file4,
|
|
2169
|
-
L:
|
|
2244
|
+
L: 359,
|
|
2170
2245
|
S: this,
|
|
2171
2246
|
C: (f, a) => f(...a)
|
|
2172
2247
|
});
|
|
@@ -2183,7 +2258,7 @@ var Swarm = class {
|
|
|
2183
2258
|
remoteId
|
|
2184
2259
|
}, {
|
|
2185
2260
|
F: __dxlog_file4,
|
|
2186
|
-
L:
|
|
2261
|
+
L: 373,
|
|
2187
2262
|
S: this,
|
|
2188
2263
|
C: (f, a) => f(...a)
|
|
2189
2264
|
});
|
|
@@ -2193,7 +2268,7 @@ var Swarm = class {
|
|
|
2193
2268
|
remoteId
|
|
2194
2269
|
}, {
|
|
2195
2270
|
F: __dxlog_file4,
|
|
2196
|
-
L:
|
|
2271
|
+
L: 376,
|
|
2197
2272
|
S: this,
|
|
2198
2273
|
C: (f, a) => f(...a)
|
|
2199
2274
|
});
|
|
@@ -2233,7 +2308,7 @@ var import_async4 = require("@dxos/async");
|
|
|
2233
2308
|
var import_keys5 = require("@dxos/keys");
|
|
2234
2309
|
var import_log5 = require("@dxos/log");
|
|
2235
2310
|
var import_util3 = require("@dxos/util");
|
|
2236
|
-
var __dxlog_file5 = "/
|
|
2311
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm-mapper.ts";
|
|
2237
2312
|
var SwarmMapper = class {
|
|
2238
2313
|
get peers() {
|
|
2239
2314
|
return Array.from(this._peers.values());
|
|
@@ -2305,7 +2380,7 @@ var import_keys6 = require("@dxos/keys");
|
|
|
2305
2380
|
var import_log6 = require("@dxos/log");
|
|
2306
2381
|
var import_protocols5 = require("@dxos/protocols");
|
|
2307
2382
|
var import_util4 = require("@dxos/util");
|
|
2308
|
-
var __dxlog_file6 = "/
|
|
2383
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection-limiter.ts";
|
|
2309
2384
|
var MAX_CONCURRENT_INITIATING_CONNECTIONS = 50;
|
|
2310
2385
|
var ConnectionLimiter = class {
|
|
2311
2386
|
constructor({ maxConcurrentInitConnections = MAX_CONCURRENT_INITIATING_CONNECTIONS } = {}) {
|
|
@@ -2454,7 +2529,7 @@ var import_messaging = require("@dxos/messaging");
|
|
|
2454
2529
|
var import_protocols6 = require("@dxos/protocols");
|
|
2455
2530
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
2456
2531
|
var import_util6 = require("@dxos/util");
|
|
2457
|
-
var __dxlog_file7 = "/
|
|
2532
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/network-manager.ts";
|
|
2458
2533
|
var NetworkManager = class {
|
|
2459
2534
|
constructor({ transportFactory, signalManager, log: log1 }) {
|
|
2460
2535
|
/**
|
|
@@ -2690,7 +2765,7 @@ var NetworkManager = class {
|
|
|
2690
2765
|
|
|
2691
2766
|
// packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts
|
|
2692
2767
|
var import_invariant7 = require("@dxos/invariant");
|
|
2693
|
-
var __dxlog_file8 = "/
|
|
2768
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts";
|
|
2694
2769
|
var FullyConnectedTopology = class {
|
|
2695
2770
|
toString() {
|
|
2696
2771
|
return "FullyConnectedTopology";
|
|
@@ -2733,7 +2808,7 @@ var FullyConnectedTopology = class {
|
|
|
2733
2808
|
var import_xor_distance = __toESM(require("xor-distance"));
|
|
2734
2809
|
var import_invariant8 = require("@dxos/invariant");
|
|
2735
2810
|
var import_log8 = require("@dxos/log");
|
|
2736
|
-
var __dxlog_file9 = "/
|
|
2811
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/mmst-topology.ts";
|
|
2737
2812
|
var MMSTTopology = class {
|
|
2738
2813
|
constructor({ originateConnections = 2, maxPeers = 4, sampleSize = 10 } = {}) {
|
|
2739
2814
|
this._sampleCollected = false;
|
|
@@ -2842,7 +2917,7 @@ var sortByXorDistance = (keys, reference) => keys.sort((a, b) => import_xor_dist
|
|
|
2842
2917
|
// packages/core/mesh/network-manager/src/topology/star-topology.ts
|
|
2843
2918
|
var import_invariant9 = require("@dxos/invariant");
|
|
2844
2919
|
var import_log9 = require("@dxos/log");
|
|
2845
|
-
var __dxlog_file10 = "/
|
|
2920
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/star-topology.ts";
|
|
2846
2921
|
var StarTopology = class {
|
|
2847
2922
|
constructor(_centralPeer) {
|
|
2848
2923
|
this._centralPeer = _centralPeer;
|
|
@@ -2953,7 +3028,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
2953
3028
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2954
3029
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2955
3030
|
}
|
|
2956
|
-
var __dxlog_file11 = "/
|
|
3031
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/memory-transport.ts";
|
|
2957
3032
|
var MEMORY_TRANSPORT_DELAY = 1;
|
|
2958
3033
|
var createStreamDelay = (delay) => {
|
|
2959
3034
|
return new import_node_stream.Transform({
|
|
@@ -3148,7 +3223,7 @@ try {
|
|
|
3148
3223
|
}
|
|
3149
3224
|
|
|
3150
3225
|
// packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts
|
|
3151
|
-
var __dxlog_file12 = "/
|
|
3226
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts";
|
|
3152
3227
|
var SimplePeerTransport = class {
|
|
3153
3228
|
constructor(params) {
|
|
3154
3229
|
this.params = params;
|
|
@@ -3337,7 +3412,7 @@ var import_keys11 = require("@dxos/keys");
|
|
|
3337
3412
|
var import_log12 = require("@dxos/log");
|
|
3338
3413
|
var import_bridge = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
3339
3414
|
var import_util8 = require("@dxos/util");
|
|
3340
|
-
var __dxlog_file13 = "/
|
|
3415
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-service.ts";
|
|
3341
3416
|
var SimplePeerTransportService = class {
|
|
3342
3417
|
constructor(_webrtcConfig) {
|
|
3343
3418
|
this._webrtcConfig = _webrtcConfig;
|
|
@@ -3480,7 +3555,7 @@ var import_log13 = require("@dxos/log");
|
|
|
3480
3555
|
var import_protocols8 = require("@dxos/protocols");
|
|
3481
3556
|
var import_bridge2 = require("@dxos/protocols/proto/dxos/mesh/bridge");
|
|
3482
3557
|
var import_util9 = require("@dxos/util");
|
|
3483
|
-
var __dxlog_file14 = "/
|
|
3558
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-proxy.ts";
|
|
3484
3559
|
var SimplePeerTransportProxy = class {
|
|
3485
3560
|
constructor(_params) {
|
|
3486
3561
|
this._params = _params;
|
|
@@ -3660,7 +3735,7 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3660
3735
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3661
3736
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3662
3737
|
}
|
|
3663
|
-
var __dxlog_file15 = "/
|
|
3738
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/libdatachannel-transport.ts";
|
|
3664
3739
|
var DATACHANNEL_LABEL = "dxos.mesh.transport";
|
|
3665
3740
|
var MAX_BUFFERED_AMOUNT = 64 * 1024;
|
|
3666
3741
|
var MAX_MESSAGE_SIZE = 64 * 1024;
|
|
@@ -3989,7 +4064,7 @@ var import_node_net = require("node:net");
|
|
|
3989
4064
|
var import_async12 = require("@dxos/async");
|
|
3990
4065
|
var import_debug8 = require("@dxos/debug");
|
|
3991
4066
|
var import_log15 = require("@dxos/log");
|
|
3992
|
-
var __dxlog_file16 = "/
|
|
4067
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/tcp-transport.ts";
|
|
3993
4068
|
var TcpTransportFactory = {
|
|
3994
4069
|
createTransport: (params) => new TcpTransport(params)
|
|
3995
4070
|
};
|