@dxos/messaging 0.6.8-main.046e6cf → 0.6.8-staging.63bcb81
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/index.mjs +466 -199
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +456 -197
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/messenger.blueprint-test.d.ts +4 -0
- package/dist/types/src/messenger.blueprint-test.d.ts.map +1 -0
- package/dist/types/src/messenger.d.ts +4 -10
- package/dist/types/src/messenger.d.ts.map +1 -1
- package/dist/types/src/signal-client/signal-client.d.ts +6 -10
- package/dist/types/src/signal-client/signal-client.d.ts.map +1 -1
- package/dist/types/src/signal-client/signal-local-state.d.ts +2 -10
- package/dist/types/src/signal-client/signal-local-state.d.ts.map +1 -1
- package/dist/types/src/signal-manager/edge-signal-manager.d.ts +18 -19
- package/dist/types/src/signal-manager/edge-signal-manager.d.ts.map +1 -1
- package/dist/types/src/signal-manager/index.d.ts +1 -0
- package/dist/types/src/signal-manager/index.d.ts.map +1 -1
- package/dist/types/src/signal-manager/memory-signal-manager.d.ts +14 -25
- package/dist/types/src/signal-manager/memory-signal-manager.d.ts.map +1 -1
- package/dist/types/src/signal-manager/signal-manager.d.ts +5 -6
- package/dist/types/src/signal-manager/signal-manager.d.ts.map +1 -1
- package/dist/types/src/signal-manager/websocket-signal-manager.d.ts +14 -29
- package/dist/types/src/signal-manager/websocket-signal-manager.d.ts.map +1 -1
- package/dist/types/src/signal-methods.d.ts +29 -14
- package/dist/types/src/signal-methods.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +5 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-builder.d.ts +19 -0
- package/dist/types/src/testing/test-builder.d.ts.map +1 -0
- package/dist/types/src/testing/test-messages.d.ts +6 -0
- package/dist/types/src/testing/test-messages.d.ts.map +1 -0
- package/dist/types/src/testing/test-peer.d.ts +23 -0
- package/dist/types/src/testing/test-peer.d.ts.map +1 -0
- package/dist/types/src/testing/utils.d.ts +10 -0
- package/dist/types/src/testing/utils.d.ts.map +1 -0
- package/package.json +15 -14
- package/src/messenger.blueprint-test.ts +346 -0
- package/src/messenger.test.ts +26 -362
- package/src/messenger.ts +20 -18
- package/src/signal-client/signal-client-monitor.ts +3 -3
- package/src/signal-client/signal-client.test.ts +56 -52
- package/src/signal-client/signal-client.ts +30 -16
- package/src/signal-client/signal-local-state.ts +28 -10
- package/src/signal-manager/edge-signal-manager.test.ts +31 -35
- package/src/signal-manager/edge-signal-manager.ts +88 -36
- package/src/signal-manager/index.ts +1 -0
- package/src/signal-manager/memory-signal-manager.ts +36 -50
- package/src/signal-manager/signal-manager.ts +5 -7
- package/src/signal-manager/websocket-signal-manager.test.ts +27 -31
- package/src/signal-manager/websocket-signal-manager.ts +34 -65
- package/src/signal-methods.ts +33 -11
- package/src/testing/index.ts +8 -0
- package/src/testing/test-builder.ts +54 -0
- package/src/testing/test-messages.ts +24 -0
- package/src/testing/test-peer.ts +66 -0
- package/src/testing/utils.ts +50 -0
- package/dist/types/src/testing.d.ts +0 -40
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/testing.ts +0 -120
|
@@ -44,9 +44,9 @@ var Messenger = class {
|
|
|
44
44
|
constructor({ signalManager, retryDelay = 300 }) {
|
|
45
45
|
this._monitor = new MessengerMonitor();
|
|
46
46
|
// { peerId, payloadType } => listeners set
|
|
47
|
-
this._listeners = new ComplexMap(({ peerId, payloadType }) => peerId
|
|
47
|
+
this._listeners = new ComplexMap(({ peerId, payloadType }) => peerId + payloadType);
|
|
48
48
|
// peerId => listeners set
|
|
49
|
-
this._defaultListeners = new
|
|
49
|
+
this._defaultListeners = /* @__PURE__ */ new Map();
|
|
50
50
|
this._onAckCallbacks = new ComplexMap(PublicKey.hash);
|
|
51
51
|
this._receivedMessages = new ComplexSet(PublicKey.hash);
|
|
52
52
|
/**
|
|
@@ -214,7 +214,7 @@ var Messenger = class {
|
|
|
214
214
|
* Subscribes onMessage function to messages that contains payload with payloadType.
|
|
215
215
|
* @param payloadType if not specified, onMessage will be subscribed to all types of messages.
|
|
216
216
|
*/
|
|
217
|
-
async listen({
|
|
217
|
+
async listen({ peer, payloadType, onMessage }) {
|
|
218
218
|
invariant(!this._closed, "Closed", {
|
|
219
219
|
F: __dxlog_file,
|
|
220
220
|
L: 177,
|
|
@@ -224,23 +224,32 @@ var Messenger = class {
|
|
|
224
224
|
"'Closed'"
|
|
225
225
|
]
|
|
226
226
|
});
|
|
227
|
-
await this._signalManager.subscribeMessages(
|
|
227
|
+
await this._signalManager.subscribeMessages(peer);
|
|
228
228
|
let listeners;
|
|
229
|
+
invariant(peer.peerKey, "Peer key is required", {
|
|
230
|
+
F: __dxlog_file,
|
|
231
|
+
L: 181,
|
|
232
|
+
S: this,
|
|
233
|
+
A: [
|
|
234
|
+
"peer.peerKey",
|
|
235
|
+
"'Peer key is required'"
|
|
236
|
+
]
|
|
237
|
+
});
|
|
229
238
|
if (!payloadType) {
|
|
230
|
-
listeners = this._defaultListeners.get(
|
|
239
|
+
listeners = this._defaultListeners.get(peer.peerKey);
|
|
231
240
|
if (!listeners) {
|
|
232
241
|
listeners = /* @__PURE__ */ new Set();
|
|
233
|
-
this._defaultListeners.set(
|
|
242
|
+
this._defaultListeners.set(peer.peerKey, listeners);
|
|
234
243
|
}
|
|
235
244
|
} else {
|
|
236
245
|
listeners = this._listeners.get({
|
|
237
|
-
peerId,
|
|
246
|
+
peerId: peer.peerKey,
|
|
238
247
|
payloadType
|
|
239
248
|
});
|
|
240
249
|
if (!listeners) {
|
|
241
250
|
listeners = /* @__PURE__ */ new Set();
|
|
242
251
|
this._listeners.set({
|
|
243
|
-
peerId,
|
|
252
|
+
peerId: peer.peerKey,
|
|
244
253
|
payloadType
|
|
245
254
|
}, listeners);
|
|
246
255
|
}
|
|
@@ -281,7 +290,7 @@ var Messenger = class {
|
|
|
281
290
|
async _handleReliablePayload({ author, recipient, payload }) {
|
|
282
291
|
invariant(payload.type_url === "dxos.mesh.messaging.ReliablePayload", void 0, {
|
|
283
292
|
F: __dxlog_file,
|
|
284
|
-
L:
|
|
293
|
+
L: 239,
|
|
285
294
|
S: this,
|
|
286
295
|
A: [
|
|
287
296
|
"payload.type_url === 'dxos.mesh.messaging.ReliablePayload'",
|
|
@@ -295,7 +304,7 @@ var Messenger = class {
|
|
|
295
304
|
messageId: reliablePayload.messageId
|
|
296
305
|
}, {
|
|
297
306
|
F: __dxlog_file,
|
|
298
|
-
L:
|
|
307
|
+
L: 242,
|
|
299
308
|
S: this,
|
|
300
309
|
C: (f, a) => f(...a)
|
|
301
310
|
});
|
|
@@ -322,7 +331,7 @@ var Messenger = class {
|
|
|
322
331
|
async _handleAcknowledgement({ payload }) {
|
|
323
332
|
invariant(payload.type_url === "dxos.mesh.messaging.Acknowledgement", void 0, {
|
|
324
333
|
F: __dxlog_file,
|
|
325
|
-
L:
|
|
334
|
+
L: 270,
|
|
326
335
|
S: this,
|
|
327
336
|
A: [
|
|
328
337
|
"payload.type_url === 'dxos.mesh.messaging.Acknowledgement'",
|
|
@@ -338,7 +347,7 @@ var Messenger = class {
|
|
|
338
347
|
to: author
|
|
339
348
|
}, {
|
|
340
349
|
F: __dxlog_file,
|
|
341
|
-
L:
|
|
350
|
+
L: 283,
|
|
342
351
|
S: this,
|
|
343
352
|
C: (f, a) => f(...a)
|
|
344
353
|
});
|
|
@@ -355,7 +364,16 @@ var Messenger = class {
|
|
|
355
364
|
}
|
|
356
365
|
async _callListeners(message) {
|
|
357
366
|
{
|
|
358
|
-
|
|
367
|
+
invariant(message.recipient.peerKey, "Peer key is required", {
|
|
368
|
+
F: __dxlog_file,
|
|
369
|
+
L: 297,
|
|
370
|
+
S: this,
|
|
371
|
+
A: [
|
|
372
|
+
"message.recipient.peerKey",
|
|
373
|
+
"'Peer key is required'"
|
|
374
|
+
]
|
|
375
|
+
});
|
|
376
|
+
const defaultListenerMap = this._defaultListeners.get(message.recipient.peerKey);
|
|
359
377
|
if (defaultListenerMap) {
|
|
360
378
|
for (const listener of defaultListenerMap) {
|
|
361
379
|
await listener(message);
|
|
@@ -364,7 +382,7 @@ var Messenger = class {
|
|
|
364
382
|
}
|
|
365
383
|
{
|
|
366
384
|
const listenerMap = this._listeners.get({
|
|
367
|
-
peerId: message.recipient,
|
|
385
|
+
peerId: message.recipient.peerKey,
|
|
368
386
|
payloadType: message.payload.type_url
|
|
369
387
|
});
|
|
370
388
|
if (listenerMap) {
|
|
@@ -389,7 +407,7 @@ var Messenger = class {
|
|
|
389
407
|
elapsed
|
|
390
408
|
}, {
|
|
391
409
|
F: __dxlog_file,
|
|
392
|
-
L:
|
|
410
|
+
L: 332,
|
|
393
411
|
S: this,
|
|
394
412
|
C: (f, a) => f(...a)
|
|
395
413
|
});
|
|
@@ -497,11 +515,11 @@ var SignalClientMonitor = class {
|
|
|
497
515
|
}
|
|
498
516
|
};
|
|
499
517
|
var getByteCount = (message) => {
|
|
500
|
-
return message.author.
|
|
518
|
+
return message.author.peerKey.length + message.recipient.peerKey.length + message.payload.type_url.length + message.payload.value.length;
|
|
501
519
|
};
|
|
502
520
|
var createIdentityTags = (message) => {
|
|
503
521
|
return {
|
|
504
|
-
peer: message.author.
|
|
522
|
+
peer: message.author.peerKey
|
|
505
523
|
};
|
|
506
524
|
};
|
|
507
525
|
|
|
@@ -565,7 +583,7 @@ var SignalLocalState = class {
|
|
|
565
583
|
peerId
|
|
566
584
|
}, {
|
|
567
585
|
F: __dxlog_file2,
|
|
568
|
-
L:
|
|
586
|
+
L: 79,
|
|
569
587
|
S: this,
|
|
570
588
|
C: (f, a) => f(...a)
|
|
571
589
|
});
|
|
@@ -617,14 +635,28 @@ var SignalLocalState = class {
|
|
|
617
635
|
swarmEvent
|
|
618
636
|
}, {
|
|
619
637
|
F: __dxlog_file2,
|
|
620
|
-
L:
|
|
638
|
+
L: 115,
|
|
621
639
|
S: this,
|
|
622
640
|
C: (f, a) => f(...a)
|
|
623
641
|
});
|
|
624
|
-
|
|
642
|
+
const event = swarmEvent.peerAvailable ? {
|
|
625
643
|
topic,
|
|
626
|
-
|
|
627
|
-
|
|
644
|
+
peerAvailable: {
|
|
645
|
+
...swarmEvent.peerAvailable,
|
|
646
|
+
peer: {
|
|
647
|
+
peerKey: PublicKey2.from(swarmEvent.peerAvailable.peer).toHex()
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
} : {
|
|
651
|
+
topic,
|
|
652
|
+
peerLeft: {
|
|
653
|
+
...swarmEvent.peerLeft,
|
|
654
|
+
peer: {
|
|
655
|
+
peerKey: PublicKey2.from(swarmEvent.peerLeft.peer).toHex()
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
await this._onSwarmEvent(event);
|
|
628
660
|
}
|
|
629
661
|
});
|
|
630
662
|
this._swarmStreams.set({
|
|
@@ -653,8 +685,12 @@ var SignalLocalState = class {
|
|
|
653
685
|
peerId
|
|
654
686
|
})) {
|
|
655
687
|
const message = {
|
|
656
|
-
author:
|
|
657
|
-
|
|
688
|
+
author: {
|
|
689
|
+
peerKey: PublicKey2.from(signalMessage.author).toHex()
|
|
690
|
+
},
|
|
691
|
+
recipient: {
|
|
692
|
+
peerKey: PublicKey2.from(signalMessage.recipient).toHex()
|
|
693
|
+
},
|
|
658
694
|
payload: signalMessage.payload
|
|
659
695
|
};
|
|
660
696
|
await this._onMessage(message);
|
|
@@ -967,7 +1003,7 @@ var SignalClient = class extends Resource {
|
|
|
967
1003
|
id: this._instanceId
|
|
968
1004
|
}), {
|
|
969
1005
|
F: __dxlog_file4,
|
|
970
|
-
L:
|
|
1006
|
+
L: 92,
|
|
971
1007
|
S: this,
|
|
972
1008
|
C: (f, a) => f(...a)
|
|
973
1009
|
});
|
|
@@ -985,7 +1021,7 @@ var SignalClient = class extends Resource {
|
|
|
985
1021
|
}));
|
|
986
1022
|
invariant3(this._state === SignalState.CONNECTED, "Not connected to Signal Server", {
|
|
987
1023
|
F: __dxlog_file4,
|
|
988
|
-
L:
|
|
1024
|
+
L: 102,
|
|
989
1025
|
S: this,
|
|
990
1026
|
A: [
|
|
991
1027
|
"this._state === SignalState.CONNECTED",
|
|
@@ -1028,7 +1064,7 @@ var SignalClient = class extends Resource {
|
|
|
1028
1064
|
id: this._instanceId
|
|
1029
1065
|
}), {
|
|
1030
1066
|
F: __dxlog_file4,
|
|
1031
|
-
L:
|
|
1067
|
+
L: 135,
|
|
1032
1068
|
S: this,
|
|
1033
1069
|
C: (f, a) => f(...a)
|
|
1034
1070
|
});
|
|
@@ -1040,7 +1076,7 @@ var SignalClient = class extends Resource {
|
|
|
1040
1076
|
if (this._state === SignalState.CONNECTED && !this._lastReconciliationFailed) {
|
|
1041
1077
|
log4.warn("SignalClient error:", err, {
|
|
1042
1078
|
F: __dxlog_file4,
|
|
1043
|
-
L:
|
|
1079
|
+
L: 144,
|
|
1044
1080
|
S: this,
|
|
1045
1081
|
C: (f, a) => f(...a)
|
|
1046
1082
|
});
|
|
@@ -1050,7 +1086,7 @@ var SignalClient = class extends Resource {
|
|
|
1050
1086
|
async _close() {
|
|
1051
1087
|
log4("closing...", void 0, {
|
|
1052
1088
|
F: __dxlog_file4,
|
|
1053
|
-
L:
|
|
1089
|
+
L: 150,
|
|
1054
1090
|
S: this,
|
|
1055
1091
|
C: (f, a) => f(...a)
|
|
1056
1092
|
});
|
|
@@ -1063,7 +1099,7 @@ var SignalClient = class extends Resource {
|
|
|
1063
1099
|
await this._safeResetClient();
|
|
1064
1100
|
log4("closed", void 0, {
|
|
1065
1101
|
F: __dxlog_file4,
|
|
1066
|
-
L:
|
|
1102
|
+
L: 158,
|
|
1067
1103
|
S: this,
|
|
1068
1104
|
C: (f, a) => f(...a)
|
|
1069
1105
|
});
|
|
@@ -1080,67 +1116,113 @@ var SignalClient = class extends Resource {
|
|
|
1080
1116
|
async join(args) {
|
|
1081
1117
|
log4("joining", {
|
|
1082
1118
|
topic: args.topic,
|
|
1083
|
-
peerId: args.
|
|
1119
|
+
peerId: args.peer.peerKey
|
|
1084
1120
|
}, {
|
|
1085
1121
|
F: __dxlog_file4,
|
|
1086
|
-
L:
|
|
1122
|
+
L: 172,
|
|
1087
1123
|
S: this,
|
|
1088
1124
|
C: (f, a) => f(...a)
|
|
1089
1125
|
});
|
|
1090
1126
|
this._monitor.recordJoin();
|
|
1091
|
-
this.localState.join(
|
|
1127
|
+
this.localState.join({
|
|
1128
|
+
topic: args.topic,
|
|
1129
|
+
peerId: PublicKey4.from(args.peer.peerKey)
|
|
1130
|
+
});
|
|
1092
1131
|
this._reconcileTask?.schedule();
|
|
1093
1132
|
}
|
|
1094
1133
|
async leave(args) {
|
|
1095
1134
|
log4("leaving", {
|
|
1096
1135
|
topic: args.topic,
|
|
1097
|
-
peerId: args.
|
|
1136
|
+
peerId: args.peer.peerKey
|
|
1098
1137
|
}, {
|
|
1099
1138
|
F: __dxlog_file4,
|
|
1100
|
-
L:
|
|
1139
|
+
L: 179,
|
|
1101
1140
|
S: this,
|
|
1102
1141
|
C: (f, a) => f(...a)
|
|
1103
1142
|
});
|
|
1104
1143
|
this._monitor.recordLeave();
|
|
1105
|
-
this.localState.leave(
|
|
1144
|
+
this.localState.leave({
|
|
1145
|
+
topic: args.topic,
|
|
1146
|
+
peerId: PublicKey4.from(args.peer.peerKey)
|
|
1147
|
+
});
|
|
1106
1148
|
}
|
|
1107
1149
|
async sendMessage(msg) {
|
|
1108
1150
|
return this._monitor.recordMessageSending(msg, async () => {
|
|
1109
1151
|
await this._clientReady.wait();
|
|
1110
1152
|
invariant3(this._state === SignalState.CONNECTED, "Not connected to Signal Server", {
|
|
1111
1153
|
F: __dxlog_file4,
|
|
1112
|
-
L:
|
|
1154
|
+
L: 187,
|
|
1113
1155
|
S: this,
|
|
1114
1156
|
A: [
|
|
1115
1157
|
"this._state === SignalState.CONNECTED",
|
|
1116
1158
|
"'Not connected to Signal Server'"
|
|
1117
1159
|
]
|
|
1118
1160
|
});
|
|
1119
|
-
|
|
1161
|
+
invariant3(msg.author.peerKey, "Author key required", {
|
|
1162
|
+
F: __dxlog_file4,
|
|
1163
|
+
L: 188,
|
|
1164
|
+
S: this,
|
|
1165
|
+
A: [
|
|
1166
|
+
"msg.author.peerKey",
|
|
1167
|
+
"'Author key required'"
|
|
1168
|
+
]
|
|
1169
|
+
});
|
|
1170
|
+
invariant3(msg.recipient.peerKey, "Recipient key required", {
|
|
1171
|
+
F: __dxlog_file4,
|
|
1172
|
+
L: 189,
|
|
1173
|
+
S: this,
|
|
1174
|
+
A: [
|
|
1175
|
+
"msg.recipient.peerKey",
|
|
1176
|
+
"'Recipient key required'"
|
|
1177
|
+
]
|
|
1178
|
+
});
|
|
1179
|
+
await this._client.sendMessage({
|
|
1180
|
+
author: PublicKey4.from(msg.author.peerKey),
|
|
1181
|
+
recipient: PublicKey4.from(msg.recipient.peerKey),
|
|
1182
|
+
payload: msg.payload
|
|
1183
|
+
});
|
|
1120
1184
|
});
|
|
1121
1185
|
}
|
|
1122
|
-
async subscribeMessages(
|
|
1186
|
+
async subscribeMessages(peer) {
|
|
1187
|
+
invariant3(peer.peerKey, "Peer key required", {
|
|
1188
|
+
F: __dxlog_file4,
|
|
1189
|
+
L: 199,
|
|
1190
|
+
S: this,
|
|
1191
|
+
A: [
|
|
1192
|
+
"peer.peerKey",
|
|
1193
|
+
"'Peer key required'"
|
|
1194
|
+
]
|
|
1195
|
+
});
|
|
1123
1196
|
log4("subscribing to messages", {
|
|
1124
|
-
|
|
1197
|
+
peer
|
|
1125
1198
|
}, {
|
|
1126
1199
|
F: __dxlog_file4,
|
|
1127
|
-
L:
|
|
1200
|
+
L: 200,
|
|
1128
1201
|
S: this,
|
|
1129
1202
|
C: (f, a) => f(...a)
|
|
1130
1203
|
});
|
|
1131
|
-
this.localState.subscribeMessages(
|
|
1204
|
+
this.localState.subscribeMessages(PublicKey4.from(peer.peerKey));
|
|
1132
1205
|
this._reconcileTask?.schedule();
|
|
1133
1206
|
}
|
|
1134
|
-
async unsubscribeMessages(
|
|
1207
|
+
async unsubscribeMessages(peer) {
|
|
1208
|
+
invariant3(peer.peerKey, "Peer key required", {
|
|
1209
|
+
F: __dxlog_file4,
|
|
1210
|
+
L: 206,
|
|
1211
|
+
S: this,
|
|
1212
|
+
A: [
|
|
1213
|
+
"peer.peerKey",
|
|
1214
|
+
"'Peer key required'"
|
|
1215
|
+
]
|
|
1216
|
+
});
|
|
1135
1217
|
log4("unsubscribing from messages", {
|
|
1136
|
-
|
|
1218
|
+
peer
|
|
1137
1219
|
}, {
|
|
1138
1220
|
F: __dxlog_file4,
|
|
1139
|
-
L:
|
|
1221
|
+
L: 207,
|
|
1140
1222
|
S: this,
|
|
1141
1223
|
C: (f, a) => f(...a)
|
|
1142
1224
|
});
|
|
1143
|
-
this.localState.unsubscribeMessages(
|
|
1225
|
+
this.localState.unsubscribeMessages(PublicKey4.from(peer.peerKey));
|
|
1144
1226
|
}
|
|
1145
1227
|
_scheduleReconcileAfterError() {
|
|
1146
1228
|
scheduleTask2(this._ctx, () => this._reconcileTask.schedule(), ERROR_RECONCILE_DELAY);
|
|
@@ -1151,13 +1233,13 @@ var SignalClient = class extends Resource {
|
|
|
1151
1233
|
state: this._state
|
|
1152
1234
|
}, {
|
|
1153
1235
|
F: __dxlog_file4,
|
|
1154
|
-
L:
|
|
1236
|
+
L: 216,
|
|
1155
1237
|
S: this,
|
|
1156
1238
|
C: (f, a) => f(...a)
|
|
1157
1239
|
});
|
|
1158
1240
|
invariant3(!this._client, "Client already created", {
|
|
1159
1241
|
F: __dxlog_file4,
|
|
1160
|
-
L:
|
|
1242
|
+
L: 217,
|
|
1161
1243
|
S: this,
|
|
1162
1244
|
A: [
|
|
1163
1245
|
"!this._client",
|
|
@@ -1169,7 +1251,7 @@ var SignalClient = class extends Resource {
|
|
|
1169
1251
|
this._connectionCtx.onDispose(async () => {
|
|
1170
1252
|
log4("connection context disposed", void 0, {
|
|
1171
1253
|
F: __dxlog_file4,
|
|
1172
|
-
L:
|
|
1254
|
+
L: 224,
|
|
1173
1255
|
S: this,
|
|
1174
1256
|
C: (f, a) => f(...a)
|
|
1175
1257
|
});
|
|
@@ -1184,7 +1266,7 @@ var SignalClient = class extends Resource {
|
|
|
1184
1266
|
if (client === this._client) {
|
|
1185
1267
|
log4("socket connected", void 0, {
|
|
1186
1268
|
F: __dxlog_file4,
|
|
1187
|
-
L:
|
|
1269
|
+
L: 235,
|
|
1188
1270
|
S: this,
|
|
1189
1271
|
C: (f, a) => f(...a)
|
|
1190
1272
|
});
|
|
@@ -1199,7 +1281,7 @@ var SignalClient = class extends Resource {
|
|
|
1199
1281
|
state: this._state
|
|
1200
1282
|
}, {
|
|
1201
1283
|
F: __dxlog_file4,
|
|
1202
|
-
L:
|
|
1284
|
+
L: 244,
|
|
1203
1285
|
S: this,
|
|
1204
1286
|
C: (f, a) => f(...a)
|
|
1205
1287
|
});
|
|
@@ -1216,7 +1298,7 @@ var SignalClient = class extends Resource {
|
|
|
1216
1298
|
state: this._state
|
|
1217
1299
|
}, {
|
|
1218
1300
|
F: __dxlog_file4,
|
|
1219
|
-
L:
|
|
1301
|
+
L: 256,
|
|
1220
1302
|
S: this,
|
|
1221
1303
|
C: (f, a) => f(...a)
|
|
1222
1304
|
});
|
|
@@ -1241,14 +1323,14 @@ var SignalClient = class extends Resource {
|
|
|
1241
1323
|
state: this._state
|
|
1242
1324
|
}, {
|
|
1243
1325
|
F: __dxlog_file4,
|
|
1244
|
-
L:
|
|
1326
|
+
L: 271,
|
|
1245
1327
|
S: this,
|
|
1246
1328
|
C: (f, a) => f(...a)
|
|
1247
1329
|
});
|
|
1248
1330
|
if (this._state === SignalState.RECONNECTING) {
|
|
1249
1331
|
log4.info("Signal api already reconnecting.", void 0, {
|
|
1250
1332
|
F: __dxlog_file4,
|
|
1251
|
-
L:
|
|
1333
|
+
L: 274,
|
|
1252
1334
|
S: this,
|
|
1253
1335
|
C: (f, a) => f(...a)
|
|
1254
1336
|
});
|
|
@@ -1290,7 +1372,7 @@ var SignalClient = class extends Resource {
|
|
|
1290
1372
|
status: this.getStatus()
|
|
1291
1373
|
}, {
|
|
1292
1374
|
F: __dxlog_file4,
|
|
1293
|
-
L:
|
|
1375
|
+
L: 315,
|
|
1294
1376
|
S: this,
|
|
1295
1377
|
C: (f, a) => f(...a)
|
|
1296
1378
|
});
|
|
@@ -1320,6 +1402,11 @@ import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
|
1320
1402
|
import { log as log5 } from "@dxos/log";
|
|
1321
1403
|
import { schema as schema3 } from "@dxos/protocols";
|
|
1322
1404
|
import { ComplexMap as ComplexMap3, ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
1405
|
+
|
|
1406
|
+
// packages/core/mesh/messaging/src/signal-methods.ts
|
|
1407
|
+
var PeerInfoHash = ({ peerKey }) => peerKey;
|
|
1408
|
+
|
|
1409
|
+
// packages/core/mesh/messaging/src/signal-manager/memory-signal-manager.ts
|
|
1323
1410
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/src/signal-manager/memory-signal-manager.ts";
|
|
1324
1411
|
var MemorySignalManagerContext = class {
|
|
1325
1412
|
constructor() {
|
|
@@ -1328,7 +1415,7 @@ var MemorySignalManagerContext = class {
|
|
|
1328
1415
|
// Mapping from topic to set of peers.
|
|
1329
1416
|
this.swarms = new ComplexMap3(PublicKey5.hash);
|
|
1330
1417
|
// Map of connections for each peer for signaling.
|
|
1331
|
-
this.connections = new ComplexMap3(
|
|
1418
|
+
this.connections = new ComplexMap3(PeerInfoHash);
|
|
1332
1419
|
}
|
|
1333
1420
|
};
|
|
1334
1421
|
var MemorySignalManager = class {
|
|
@@ -1337,11 +1424,11 @@ var MemorySignalManager = class {
|
|
|
1337
1424
|
this.statusChanged = new Event3();
|
|
1338
1425
|
this.swarmEvent = new Event3();
|
|
1339
1426
|
this.onMessage = new Event3();
|
|
1340
|
-
this._joinedSwarms = new ComplexSet3(({ topic,
|
|
1427
|
+
this._joinedSwarms = new ComplexSet3(({ topic, peer }) => topic.toHex() + peer.peerKey);
|
|
1341
1428
|
this._freezeTrigger = new Trigger3().wake();
|
|
1342
1429
|
this._ctx = new Context3(void 0, {
|
|
1343
1430
|
F: __dxlog_file5,
|
|
1344
|
-
L:
|
|
1431
|
+
L: 51
|
|
1345
1432
|
});
|
|
1346
1433
|
this._ctx.onDispose(this._context.swarmEvent.on((data) => this.swarmEvent.emit(data)));
|
|
1347
1434
|
}
|
|
@@ -1351,7 +1438,7 @@ var MemorySignalManager = class {
|
|
|
1351
1438
|
}
|
|
1352
1439
|
this._ctx = new Context3(void 0, {
|
|
1353
1440
|
F: __dxlog_file5,
|
|
1354
|
-
L:
|
|
1441
|
+
L: 60
|
|
1355
1442
|
});
|
|
1356
1443
|
this._ctx.onDispose(this._context.swarmEvent.on((data) => this.swarmEvent.emit(data)));
|
|
1357
1444
|
await Promise.all([
|
|
@@ -1362,7 +1449,7 @@ var MemorySignalManager = class {
|
|
|
1362
1449
|
if (this._ctx.disposed) {
|
|
1363
1450
|
return;
|
|
1364
1451
|
}
|
|
1365
|
-
const joinedSwarmsCopy = new ComplexSet3(({ topic,
|
|
1452
|
+
const joinedSwarmsCopy = new ComplexSet3(({ topic, peer }) => topic.toHex() + peer.peerKey, [
|
|
1366
1453
|
...this._joinedSwarms.values()
|
|
1367
1454
|
]);
|
|
1368
1455
|
await Promise.all([
|
|
@@ -1374,10 +1461,10 @@ var MemorySignalManager = class {
|
|
|
1374
1461
|
getStatus() {
|
|
1375
1462
|
return [];
|
|
1376
1463
|
}
|
|
1377
|
-
async join({ topic,
|
|
1464
|
+
async join({ topic, peer }) {
|
|
1378
1465
|
invariant4(!this._ctx.disposed, "Closed", {
|
|
1379
1466
|
F: __dxlog_file5,
|
|
1380
|
-
L:
|
|
1467
|
+
L: 89,
|
|
1381
1468
|
S: this,
|
|
1382
1469
|
A: [
|
|
1383
1470
|
"!this._ctx.disposed",
|
|
@@ -1386,39 +1473,35 @@ var MemorySignalManager = class {
|
|
|
1386
1473
|
});
|
|
1387
1474
|
this._joinedSwarms.add({
|
|
1388
1475
|
topic,
|
|
1389
|
-
|
|
1476
|
+
peer
|
|
1390
1477
|
});
|
|
1391
1478
|
if (!this._context.swarms.has(topic)) {
|
|
1392
|
-
this._context.swarms.set(topic, new ComplexSet3(
|
|
1479
|
+
this._context.swarms.set(topic, new ComplexSet3(PeerInfoHash));
|
|
1393
1480
|
}
|
|
1394
|
-
this._context.swarms.get(topic).add(
|
|
1481
|
+
this._context.swarms.get(topic).add(peer);
|
|
1395
1482
|
this._context.swarmEvent.emit({
|
|
1396
1483
|
topic,
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
since: /* @__PURE__ */ new Date()
|
|
1401
|
-
}
|
|
1484
|
+
peerAvailable: {
|
|
1485
|
+
peer,
|
|
1486
|
+
since: /* @__PURE__ */ new Date()
|
|
1402
1487
|
}
|
|
1403
1488
|
});
|
|
1404
|
-
for (const [topic2,
|
|
1405
|
-
Array.from(
|
|
1489
|
+
for (const [topic2, peers] of this._context.swarms) {
|
|
1490
|
+
Array.from(peers).forEach((peer2) => {
|
|
1406
1491
|
this.swarmEvent.emit({
|
|
1407
1492
|
topic: topic2,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
since: /* @__PURE__ */ new Date()
|
|
1412
|
-
}
|
|
1493
|
+
peerAvailable: {
|
|
1494
|
+
peer: peer2,
|
|
1495
|
+
since: /* @__PURE__ */ new Date()
|
|
1413
1496
|
}
|
|
1414
1497
|
});
|
|
1415
1498
|
});
|
|
1416
1499
|
}
|
|
1417
1500
|
}
|
|
1418
|
-
async leave({ topic,
|
|
1501
|
+
async leave({ topic, peer }) {
|
|
1419
1502
|
invariant4(!this._ctx.disposed, "Closed", {
|
|
1420
1503
|
F: __dxlog_file5,
|
|
1421
|
-
L:
|
|
1504
|
+
L: 121,
|
|
1422
1505
|
S: this,
|
|
1423
1506
|
A: [
|
|
1424
1507
|
"!this._ctx.disposed",
|
|
@@ -1427,21 +1510,19 @@ var MemorySignalManager = class {
|
|
|
1427
1510
|
});
|
|
1428
1511
|
this._joinedSwarms.delete({
|
|
1429
1512
|
topic,
|
|
1430
|
-
|
|
1513
|
+
peer
|
|
1431
1514
|
});
|
|
1432
1515
|
if (!this._context.swarms.has(topic)) {
|
|
1433
|
-
this._context.swarms.set(topic, new ComplexSet3(
|
|
1516
|
+
this._context.swarms.set(topic, new ComplexSet3(PeerInfoHash));
|
|
1434
1517
|
}
|
|
1435
|
-
this._context.swarms.get(topic).delete(
|
|
1518
|
+
this._context.swarms.get(topic).delete(peer);
|
|
1436
1519
|
const swarmEvent = {
|
|
1520
|
+
topic,
|
|
1437
1521
|
peerLeft: {
|
|
1438
|
-
peer
|
|
1522
|
+
peer
|
|
1439
1523
|
}
|
|
1440
1524
|
};
|
|
1441
|
-
this._context.swarmEvent.emit(
|
|
1442
|
-
topic,
|
|
1443
|
-
swarmEvent
|
|
1444
|
-
});
|
|
1525
|
+
this._context.swarmEvent.emit(swarmEvent);
|
|
1445
1526
|
}
|
|
1446
1527
|
async sendMessage({ author, recipient, payload }) {
|
|
1447
1528
|
log5("send message", {
|
|
@@ -1450,13 +1531,13 @@ var MemorySignalManager = class {
|
|
|
1450
1531
|
...dec(payload)
|
|
1451
1532
|
}, {
|
|
1452
1533
|
F: __dxlog_file5,
|
|
1453
|
-
L:
|
|
1534
|
+
L: 142,
|
|
1454
1535
|
S: this,
|
|
1455
1536
|
C: (f, a) => f(...a)
|
|
1456
1537
|
});
|
|
1457
1538
|
invariant4(recipient, void 0, {
|
|
1458
1539
|
F: __dxlog_file5,
|
|
1459
|
-
L:
|
|
1540
|
+
L: 144,
|
|
1460
1541
|
S: this,
|
|
1461
1542
|
A: [
|
|
1462
1543
|
"recipient",
|
|
@@ -1465,7 +1546,7 @@ var MemorySignalManager = class {
|
|
|
1465
1546
|
});
|
|
1466
1547
|
invariant4(!this._ctx.disposed, "Closed", {
|
|
1467
1548
|
F: __dxlog_file5,
|
|
1468
|
-
L:
|
|
1549
|
+
L: 145,
|
|
1469
1550
|
S: this,
|
|
1470
1551
|
A: [
|
|
1471
1552
|
"!this._ctx.disposed",
|
|
@@ -1480,7 +1561,7 @@ var MemorySignalManager = class {
|
|
|
1480
1561
|
recipient
|
|
1481
1562
|
}, {
|
|
1482
1563
|
F: __dxlog_file5,
|
|
1483
|
-
L:
|
|
1564
|
+
L: 151,
|
|
1484
1565
|
S: this,
|
|
1485
1566
|
C: (f, a) => f(...a)
|
|
1486
1567
|
});
|
|
@@ -1492,7 +1573,7 @@ var MemorySignalManager = class {
|
|
|
1492
1573
|
recipient
|
|
1493
1574
|
}, {
|
|
1494
1575
|
F: __dxlog_file5,
|
|
1495
|
-
L:
|
|
1576
|
+
L: 156,
|
|
1496
1577
|
S: this,
|
|
1497
1578
|
C: (f, a) => f(...a)
|
|
1498
1579
|
});
|
|
@@ -1505,7 +1586,7 @@ var MemorySignalManager = class {
|
|
|
1505
1586
|
recipient
|
|
1506
1587
|
}, {
|
|
1507
1588
|
F: __dxlog_file5,
|
|
1508
|
-
L:
|
|
1589
|
+
L: 164,
|
|
1509
1590
|
S: this,
|
|
1510
1591
|
C: (f, a) => f(...a)
|
|
1511
1592
|
});
|
|
@@ -1517,7 +1598,7 @@ var MemorySignalManager = class {
|
|
|
1517
1598
|
...dec(payload)
|
|
1518
1599
|
}, {
|
|
1519
1600
|
F: __dxlog_file5,
|
|
1520
|
-
L:
|
|
1601
|
+
L: 168,
|
|
1521
1602
|
S: this,
|
|
1522
1603
|
C: (f, a) => f(...a)
|
|
1523
1604
|
});
|
|
@@ -1531,33 +1612,33 @@ var MemorySignalManager = class {
|
|
|
1531
1612
|
err
|
|
1532
1613
|
}, {
|
|
1533
1614
|
F: __dxlog_file5,
|
|
1534
|
-
L:
|
|
1615
|
+
L: 173,
|
|
1535
1616
|
S: this,
|
|
1536
1617
|
C: (f, a) => f(...a)
|
|
1537
1618
|
});
|
|
1538
1619
|
});
|
|
1539
1620
|
}
|
|
1540
|
-
async subscribeMessages(
|
|
1621
|
+
async subscribeMessages(peerInfo) {
|
|
1541
1622
|
log5("subscribing", {
|
|
1542
|
-
|
|
1623
|
+
peerInfo
|
|
1543
1624
|
}, {
|
|
1544
1625
|
F: __dxlog_file5,
|
|
1545
|
-
L:
|
|
1626
|
+
L: 178,
|
|
1546
1627
|
S: this,
|
|
1547
1628
|
C: (f, a) => f(...a)
|
|
1548
1629
|
});
|
|
1549
|
-
this._context.connections.set(
|
|
1630
|
+
this._context.connections.set(peerInfo, this);
|
|
1550
1631
|
}
|
|
1551
|
-
async unsubscribeMessages(
|
|
1632
|
+
async unsubscribeMessages(peerInfo) {
|
|
1552
1633
|
log5("unsubscribing", {
|
|
1553
|
-
|
|
1634
|
+
peerInfo
|
|
1554
1635
|
}, {
|
|
1555
1636
|
F: __dxlog_file5,
|
|
1556
|
-
L:
|
|
1637
|
+
L: 183,
|
|
1557
1638
|
S: this,
|
|
1558
1639
|
C: (f, a) => f(...a)
|
|
1559
1640
|
});
|
|
1560
|
-
this._context.connections.delete(
|
|
1641
|
+
this._context.connections.delete(peerInfo);
|
|
1561
1642
|
}
|
|
1562
1643
|
freeze() {
|
|
1563
1644
|
this._freezeTrigger.reset();
|
|
@@ -1582,7 +1663,7 @@ var dec = (payload) => {
|
|
|
1582
1663
|
|
|
1583
1664
|
// packages/core/mesh/messaging/src/signal-manager/websocket-signal-manager.ts
|
|
1584
1665
|
import { Event as Event4, sleep as sleep2, synchronized } from "@dxos/async";
|
|
1585
|
-
import {
|
|
1666
|
+
import { LifecycleState, Resource as Resource2 } from "@dxos/context";
|
|
1586
1667
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1587
1668
|
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
1588
1669
|
import { log as log6 } from "@dxos/log";
|
|
@@ -1619,13 +1700,13 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
1619
1700
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/src/signal-manager/websocket-signal-manager.ts";
|
|
1620
1701
|
var MAX_SERVER_FAILURES = 5;
|
|
1621
1702
|
var WSS_SIGNAL_SERVER_REBOOT_DELAY = 3e3;
|
|
1622
|
-
var WebsocketSignalManager = class {
|
|
1703
|
+
var WebsocketSignalManager = class extends Resource2 {
|
|
1623
1704
|
constructor(_hosts, _getMetadata) {
|
|
1705
|
+
super();
|
|
1624
1706
|
this._hosts = _hosts;
|
|
1625
1707
|
this._getMetadata = _getMetadata;
|
|
1626
1708
|
this._servers = /* @__PURE__ */ new Map();
|
|
1627
1709
|
this._monitor = new WebsocketSignalManagerMonitor();
|
|
1628
|
-
this._opened = false;
|
|
1629
1710
|
this.failureCount = /* @__PURE__ */ new Map();
|
|
1630
1711
|
this.statusChanged = new Event4();
|
|
1631
1712
|
this.swarmEvent = new Event4();
|
|
@@ -1635,7 +1716,7 @@ var WebsocketSignalManager = class {
|
|
|
1635
1716
|
hosts: this._hosts
|
|
1636
1717
|
}, {
|
|
1637
1718
|
F: __dxlog_file6,
|
|
1638
|
-
L:
|
|
1719
|
+
L: 54,
|
|
1639
1720
|
S: this,
|
|
1640
1721
|
C: (f, a) => f(...a)
|
|
1641
1722
|
});
|
|
@@ -1652,15 +1733,12 @@ var WebsocketSignalManager = class {
|
|
|
1652
1733
|
}
|
|
1653
1734
|
this._failedServersBitfield = BitField.zeros(this._hosts.length);
|
|
1654
1735
|
}
|
|
1655
|
-
async
|
|
1656
|
-
if (this._opened) {
|
|
1657
|
-
return;
|
|
1658
|
-
}
|
|
1736
|
+
async _open() {
|
|
1659
1737
|
log6("open signal manager", {
|
|
1660
1738
|
hosts: this._hosts
|
|
1661
1739
|
}, {
|
|
1662
1740
|
F: __dxlog_file6,
|
|
1663
|
-
L:
|
|
1741
|
+
L: 74,
|
|
1664
1742
|
S: this,
|
|
1665
1743
|
C: (f, a) => f(...a)
|
|
1666
1744
|
});
|
|
@@ -1668,28 +1746,21 @@ var WebsocketSignalManager = class {
|
|
|
1668
1746
|
id: this._instanceId
|
|
1669
1747
|
}), {
|
|
1670
1748
|
F: __dxlog_file6,
|
|
1671
|
-
L:
|
|
1749
|
+
L: 75,
|
|
1672
1750
|
S: this,
|
|
1673
1751
|
C: (f, a) => f(...a)
|
|
1674
1752
|
});
|
|
1675
|
-
this._initContext();
|
|
1676
1753
|
await safeAwaitAll2(this._servers.values(), (server) => server.open());
|
|
1677
|
-
this._opened = true;
|
|
1678
1754
|
log6.trace("dxos.mesh.websocket-signal-manager.open", trace8.end({
|
|
1679
1755
|
id: this._instanceId
|
|
1680
1756
|
}), {
|
|
1681
1757
|
F: __dxlog_file6,
|
|
1682
|
-
L:
|
|
1758
|
+
L: 79,
|
|
1683
1759
|
S: this,
|
|
1684
1760
|
C: (f, a) => f(...a)
|
|
1685
1761
|
});
|
|
1686
1762
|
}
|
|
1687
|
-
async
|
|
1688
|
-
if (!this._opened) {
|
|
1689
|
-
return;
|
|
1690
|
-
}
|
|
1691
|
-
this._opened = false;
|
|
1692
|
-
await this._ctx.dispose();
|
|
1763
|
+
async _close() {
|
|
1693
1764
|
await safeAwaitAll2(this._servers.values(), (server) => server.close());
|
|
1694
1765
|
}
|
|
1695
1766
|
async restartServer(serverName) {
|
|
@@ -1697,23 +1768,23 @@ var WebsocketSignalManager = class {
|
|
|
1697
1768
|
serverName
|
|
1698
1769
|
}, {
|
|
1699
1770
|
F: __dxlog_file6,
|
|
1700
|
-
L:
|
|
1771
|
+
L: 87,
|
|
1701
1772
|
S: this,
|
|
1702
1773
|
C: (f, a) => f(...a)
|
|
1703
1774
|
});
|
|
1704
|
-
invariant5(this.
|
|
1775
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1705
1776
|
F: __dxlog_file6,
|
|
1706
|
-
L:
|
|
1777
|
+
L: 88,
|
|
1707
1778
|
S: this,
|
|
1708
1779
|
A: [
|
|
1709
|
-
"this.
|
|
1710
|
-
"
|
|
1780
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1781
|
+
""
|
|
1711
1782
|
]
|
|
1712
1783
|
});
|
|
1713
1784
|
const server = this._servers.get(serverName);
|
|
1714
1785
|
invariant5(server, "server not found", {
|
|
1715
1786
|
F: __dxlog_file6,
|
|
1716
|
-
L:
|
|
1787
|
+
L: 91,
|
|
1717
1788
|
S: this,
|
|
1718
1789
|
A: [
|
|
1719
1790
|
"server",
|
|
@@ -1727,52 +1798,52 @@ var WebsocketSignalManager = class {
|
|
|
1727
1798
|
getStatus() {
|
|
1728
1799
|
return Array.from(this._servers.values()).map((server) => server.getStatus());
|
|
1729
1800
|
}
|
|
1730
|
-
async join({ topic,
|
|
1801
|
+
async join({ topic, peer }) {
|
|
1731
1802
|
log6("join", {
|
|
1732
1803
|
topic,
|
|
1733
|
-
|
|
1804
|
+
peer
|
|
1734
1805
|
}, {
|
|
1735
1806
|
F: __dxlog_file6,
|
|
1736
|
-
L:
|
|
1807
|
+
L: 104,
|
|
1737
1808
|
S: this,
|
|
1738
1809
|
C: (f, a) => f(...a)
|
|
1739
1810
|
});
|
|
1740
|
-
invariant5(this.
|
|
1811
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1741
1812
|
F: __dxlog_file6,
|
|
1742
|
-
L:
|
|
1813
|
+
L: 105,
|
|
1743
1814
|
S: this,
|
|
1744
1815
|
A: [
|
|
1745
|
-
"this.
|
|
1746
|
-
"
|
|
1816
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1817
|
+
""
|
|
1747
1818
|
]
|
|
1748
1819
|
});
|
|
1749
1820
|
await this._forEachServer((server) => server.join({
|
|
1750
1821
|
topic,
|
|
1751
|
-
|
|
1822
|
+
peer
|
|
1752
1823
|
}));
|
|
1753
1824
|
}
|
|
1754
|
-
async leave({ topic,
|
|
1825
|
+
async leave({ topic, peer }) {
|
|
1755
1826
|
log6("leaving", {
|
|
1756
1827
|
topic,
|
|
1757
|
-
|
|
1828
|
+
peer
|
|
1758
1829
|
}, {
|
|
1759
1830
|
F: __dxlog_file6,
|
|
1760
|
-
L:
|
|
1831
|
+
L: 111,
|
|
1761
1832
|
S: this,
|
|
1762
1833
|
C: (f, a) => f(...a)
|
|
1763
1834
|
});
|
|
1764
|
-
invariant5(this.
|
|
1835
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1765
1836
|
F: __dxlog_file6,
|
|
1766
|
-
L:
|
|
1837
|
+
L: 112,
|
|
1767
1838
|
S: this,
|
|
1768
1839
|
A: [
|
|
1769
|
-
"this.
|
|
1770
|
-
"
|
|
1840
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1841
|
+
""
|
|
1771
1842
|
]
|
|
1772
1843
|
});
|
|
1773
1844
|
await this._forEachServer((server) => server.leave({
|
|
1774
1845
|
topic,
|
|
1775
|
-
|
|
1846
|
+
peer
|
|
1776
1847
|
}));
|
|
1777
1848
|
}
|
|
1778
1849
|
async sendMessage({ author, recipient, payload }) {
|
|
@@ -1780,17 +1851,17 @@ var WebsocketSignalManager = class {
|
|
|
1780
1851
|
recipient
|
|
1781
1852
|
}, {
|
|
1782
1853
|
F: __dxlog_file6,
|
|
1783
|
-
L:
|
|
1854
|
+
L: 117,
|
|
1784
1855
|
S: this,
|
|
1785
1856
|
C: (f, a) => f(...a)
|
|
1786
1857
|
});
|
|
1787
|
-
invariant5(this.
|
|
1858
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1788
1859
|
F: __dxlog_file6,
|
|
1789
|
-
L:
|
|
1860
|
+
L: 118,
|
|
1790
1861
|
S: this,
|
|
1791
1862
|
A: [
|
|
1792
|
-
"this.
|
|
1793
|
-
"
|
|
1863
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1864
|
+
""
|
|
1794
1865
|
]
|
|
1795
1866
|
});
|
|
1796
1867
|
void this._forEachServer(async (server, serverName, index) => {
|
|
@@ -1804,7 +1875,7 @@ var WebsocketSignalManager = class {
|
|
|
1804
1875
|
err
|
|
1805
1876
|
}, {
|
|
1806
1877
|
F: __dxlog_file6,
|
|
1807
|
-
L:
|
|
1878
|
+
L: 126,
|
|
1808
1879
|
S: this,
|
|
1809
1880
|
C: (f, a) => f(...a)
|
|
1810
1881
|
});
|
|
@@ -1814,7 +1885,7 @@ var WebsocketSignalManager = class {
|
|
|
1814
1885
|
err
|
|
1815
1886
|
}, {
|
|
1816
1887
|
F: __dxlog_file6,
|
|
1817
|
-
L:
|
|
1888
|
+
L: 129,
|
|
1818
1889
|
S: this,
|
|
1819
1890
|
C: (f, a) => f(...a)
|
|
1820
1891
|
});
|
|
@@ -1824,7 +1895,7 @@ var WebsocketSignalManager = class {
|
|
|
1824
1895
|
err
|
|
1825
1896
|
}, {
|
|
1826
1897
|
F: __dxlog_file6,
|
|
1827
|
-
L:
|
|
1898
|
+
L: 132,
|
|
1828
1899
|
S: this,
|
|
1829
1900
|
C: (f, a) => f(...a)
|
|
1830
1901
|
});
|
|
@@ -1847,7 +1918,7 @@ var WebsocketSignalManager = class {
|
|
|
1847
1918
|
failureCount
|
|
1848
1919
|
}, {
|
|
1849
1920
|
F: __dxlog_file6,
|
|
1850
|
-
L:
|
|
1921
|
+
L: 146,
|
|
1851
1922
|
S: this,
|
|
1852
1923
|
C: (f, a) => f(...a)
|
|
1853
1924
|
});
|
|
@@ -1865,7 +1936,7 @@ var WebsocketSignalManager = class {
|
|
|
1865
1936
|
serverName
|
|
1866
1937
|
}, {
|
|
1867
1938
|
F: __dxlog_file6,
|
|
1868
|
-
L:
|
|
1939
|
+
L: 159,
|
|
1869
1940
|
S: this,
|
|
1870
1941
|
C: (f, a) => f(...a)
|
|
1871
1942
|
});
|
|
@@ -1873,69 +1944,50 @@ var WebsocketSignalManager = class {
|
|
|
1873
1944
|
this.failureCount.set(serverName, 0);
|
|
1874
1945
|
}
|
|
1875
1946
|
}
|
|
1876
|
-
async subscribeMessages(
|
|
1947
|
+
async subscribeMessages(peer) {
|
|
1877
1948
|
log6("subscribed for message stream", {
|
|
1878
|
-
|
|
1949
|
+
peer
|
|
1879
1950
|
}, {
|
|
1880
1951
|
F: __dxlog_file6,
|
|
1881
|
-
L:
|
|
1952
|
+
L: 166,
|
|
1882
1953
|
S: this,
|
|
1883
1954
|
C: (f, a) => f(...a)
|
|
1884
1955
|
});
|
|
1885
|
-
invariant5(this.
|
|
1956
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1886
1957
|
F: __dxlog_file6,
|
|
1887
|
-
L:
|
|
1958
|
+
L: 167,
|
|
1888
1959
|
S: this,
|
|
1889
1960
|
A: [
|
|
1890
|
-
"this.
|
|
1891
|
-
"
|
|
1961
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1962
|
+
""
|
|
1892
1963
|
]
|
|
1893
1964
|
});
|
|
1894
|
-
await this._forEachServer(async (server) => server.subscribeMessages(
|
|
1965
|
+
await this._forEachServer(async (server) => server.subscribeMessages(peer));
|
|
1895
1966
|
}
|
|
1896
|
-
async unsubscribeMessages(
|
|
1967
|
+
async unsubscribeMessages(peer) {
|
|
1897
1968
|
log6("subscribed for message stream", {
|
|
1898
|
-
|
|
1969
|
+
peer
|
|
1899
1970
|
}, {
|
|
1900
1971
|
F: __dxlog_file6,
|
|
1901
|
-
L:
|
|
1972
|
+
L: 173,
|
|
1902
1973
|
S: this,
|
|
1903
1974
|
C: (f, a) => f(...a)
|
|
1904
1975
|
});
|
|
1905
|
-
invariant5(this.
|
|
1976
|
+
invariant5(this._lifecycleState === LifecycleState.OPEN, void 0, {
|
|
1906
1977
|
F: __dxlog_file6,
|
|
1907
|
-
L:
|
|
1978
|
+
L: 174,
|
|
1908
1979
|
S: this,
|
|
1909
1980
|
A: [
|
|
1910
|
-
"this.
|
|
1911
|
-
"
|
|
1981
|
+
"this._lifecycleState === LifecycleState.OPEN",
|
|
1982
|
+
""
|
|
1912
1983
|
]
|
|
1913
1984
|
});
|
|
1914
|
-
await this._forEachServer(async (server) => server.unsubscribeMessages(
|
|
1915
|
-
}
|
|
1916
|
-
_initContext() {
|
|
1917
|
-
this._ctx = new Context4({
|
|
1918
|
-
onError: (err) => log6.catch(err, void 0, {
|
|
1919
|
-
F: __dxlog_file6,
|
|
1920
|
-
L: 206,
|
|
1921
|
-
S: this,
|
|
1922
|
-
C: (f, a) => f(...a)
|
|
1923
|
-
})
|
|
1924
|
-
}, {
|
|
1925
|
-
F: __dxlog_file6,
|
|
1926
|
-
L: 205
|
|
1927
|
-
});
|
|
1985
|
+
await this._forEachServer(async (server) => server.unsubscribeMessages(peer));
|
|
1928
1986
|
}
|
|
1929
1987
|
async _forEachServer(fn) {
|
|
1930
1988
|
return Promise.all(Array.from(this._servers.entries()).map(([serverName, server], idx) => fn(server, serverName, idx)));
|
|
1931
1989
|
}
|
|
1932
1990
|
};
|
|
1933
|
-
_ts_decorate([
|
|
1934
|
-
synchronized
|
|
1935
|
-
], WebsocketSignalManager.prototype, "open", null);
|
|
1936
|
-
_ts_decorate([
|
|
1937
|
-
synchronized
|
|
1938
|
-
], WebsocketSignalManager.prototype, "close", null);
|
|
1939
1991
|
_ts_decorate([
|
|
1940
1992
|
synchronized
|
|
1941
1993
|
], WebsocketSignalManager.prototype, "join", null);
|
|
@@ -1946,18 +1998,231 @@ _ts_decorate([
|
|
|
1946
1998
|
synchronized
|
|
1947
1999
|
], WebsocketSignalManager.prototype, "checkServerFailure", null);
|
|
1948
2000
|
|
|
1949
|
-
// packages/core/mesh/messaging/src/signal-manager/
|
|
2001
|
+
// packages/core/mesh/messaging/src/signal-manager/edge-signal-manager.ts
|
|
2002
|
+
import { AnySchema } from "@bufbuild/protobuf/wkt";
|
|
2003
|
+
import { Event as Event5 } from "@dxos/async";
|
|
2004
|
+
import { Resource as Resource3 } from "@dxos/context";
|
|
2005
|
+
import { protocol } from "@dxos/edge-client";
|
|
1950
2006
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
2007
|
+
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
1951
2008
|
import { log as log7 } from "@dxos/log";
|
|
2009
|
+
import { EdgeService } from "@dxos/protocols";
|
|
2010
|
+
import { SwarmRequestSchema, SwarmRequest_Action as SwarmRequestAction, SwarmResponseSchema } from "@dxos/protocols/buf/dxos/edge/messenger_pb";
|
|
2011
|
+
import { ComplexMap as ComplexMap4, ComplexSet as ComplexSet4 } from "@dxos/util";
|
|
2012
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/src/signal-manager/edge-signal-manager.ts";
|
|
2013
|
+
var EdgeSignalManager = class extends Resource3 {
|
|
2014
|
+
constructor({ edgeConnection }) {
|
|
2015
|
+
super();
|
|
2016
|
+
this.swarmEvent = new Event5();
|
|
2017
|
+
this.onMessage = new Event5();
|
|
2018
|
+
/**
|
|
2019
|
+
* swarm key -> peerKeys in the swarm
|
|
2020
|
+
*/
|
|
2021
|
+
// TODO(mykola): This class should not contain swarm state. Temporary before network-manager API changes to accept list of peers.
|
|
2022
|
+
this._swarmPeers = new ComplexMap4(PublicKey7.hash);
|
|
2023
|
+
this._edgeConnection = edgeConnection;
|
|
2024
|
+
}
|
|
2025
|
+
async _open() {
|
|
2026
|
+
this._ctx.onDispose(this._edgeConnection.addListener((message) => this._onMessage(message)));
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Warning: PeerInfo is inferred from edgeConnection.
|
|
2030
|
+
*/
|
|
2031
|
+
async join({ topic, peer }) {
|
|
2032
|
+
if (!this._matchSelfPeerInfo(peer)) {
|
|
2033
|
+
log7.warn("ignoring peer info on join request", {
|
|
2034
|
+
peer,
|
|
2035
|
+
expected: {
|
|
2036
|
+
peerKey: this._edgeConnection.deviceKey.toHex(),
|
|
2037
|
+
identityKey: this._edgeConnection.identityKey.toHex()
|
|
2038
|
+
}
|
|
2039
|
+
}, {
|
|
2040
|
+
F: __dxlog_file7,
|
|
2041
|
+
L: 51,
|
|
2042
|
+
S: this,
|
|
2043
|
+
C: (f, a) => f(...a)
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
this._swarmPeers.set(topic, new ComplexSet4(PeerInfoHash));
|
|
2047
|
+
await this._edgeConnection.send(protocol.createMessage(SwarmRequestSchema, {
|
|
2048
|
+
serviceId: EdgeService.SWARM_SERVICE_ID,
|
|
2049
|
+
payload: {
|
|
2050
|
+
action: SwarmRequestAction.JOIN,
|
|
2051
|
+
swarmKeys: [
|
|
2052
|
+
topic.toHex()
|
|
2053
|
+
]
|
|
2054
|
+
}
|
|
2055
|
+
}));
|
|
2056
|
+
}
|
|
2057
|
+
async leave({ topic, peer }) {
|
|
2058
|
+
this._swarmPeers.delete(topic);
|
|
2059
|
+
await this._edgeConnection.send(protocol.createMessage(SwarmRequestSchema, {
|
|
2060
|
+
serviceId: EdgeService.SWARM_SERVICE_ID,
|
|
2061
|
+
payload: {
|
|
2062
|
+
action: SwarmRequestAction.LEAVE,
|
|
2063
|
+
swarmKeys: [
|
|
2064
|
+
topic.toHex()
|
|
2065
|
+
]
|
|
2066
|
+
}
|
|
2067
|
+
}));
|
|
2068
|
+
}
|
|
2069
|
+
async sendMessage(message) {
|
|
2070
|
+
if (!this._matchSelfPeerInfo(message.author)) {
|
|
2071
|
+
log7.warn("ignoring author on send request", {
|
|
2072
|
+
author: message.author,
|
|
2073
|
+
expected: {
|
|
2074
|
+
peerKey: this._edgeConnection.deviceKey,
|
|
2075
|
+
identityKey: this._edgeConnection.identityKey
|
|
2076
|
+
}
|
|
2077
|
+
}, {
|
|
2078
|
+
F: __dxlog_file7,
|
|
2079
|
+
L: 82,
|
|
2080
|
+
S: this,
|
|
2081
|
+
C: (f, a) => f(...a)
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
await this._edgeConnection.send(protocol.createMessage(AnySchema, {
|
|
2085
|
+
serviceId: EdgeService.SIGNAL_SERVICE_ID,
|
|
2086
|
+
source: message.author,
|
|
2087
|
+
target: [
|
|
2088
|
+
message.recipient
|
|
2089
|
+
],
|
|
2090
|
+
payload: {
|
|
2091
|
+
typeUrl: message.payload.type_url,
|
|
2092
|
+
value: message.payload.value
|
|
2093
|
+
}
|
|
2094
|
+
}));
|
|
2095
|
+
}
|
|
2096
|
+
async subscribeMessages(peerInfo) {
|
|
2097
|
+
}
|
|
2098
|
+
async unsubscribeMessages(peerInfo) {
|
|
2099
|
+
}
|
|
2100
|
+
_onMessage(message) {
|
|
2101
|
+
switch (message.serviceId) {
|
|
2102
|
+
case EdgeService.SWARM_SERVICE_ID: {
|
|
2103
|
+
this._processSwarmResponse(message);
|
|
2104
|
+
break;
|
|
2105
|
+
}
|
|
2106
|
+
case EdgeService.SIGNAL_SERVICE_ID: {
|
|
2107
|
+
this._processMessage(message);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
_processSwarmResponse(message) {
|
|
2112
|
+
invariant6(protocol.getPayloadType(message) === SwarmResponseSchema.typeName, "Wrong payload type", {
|
|
2113
|
+
F: __dxlog_file7,
|
|
2114
|
+
L: 119,
|
|
2115
|
+
S: this,
|
|
2116
|
+
A: [
|
|
2117
|
+
"protocol.getPayloadType(message) === SwarmResponseSchema.typeName",
|
|
2118
|
+
"'Wrong payload type'"
|
|
2119
|
+
]
|
|
2120
|
+
});
|
|
2121
|
+
const payload = protocol.getPayload(message, SwarmResponseSchema);
|
|
2122
|
+
const topic = PublicKey7.from(payload.swarmKey);
|
|
2123
|
+
if (!this._swarmPeers.has(topic)) {
|
|
2124
|
+
log7.warn("Received message from wrong topic", {
|
|
2125
|
+
topic
|
|
2126
|
+
}, {
|
|
2127
|
+
F: __dxlog_file7,
|
|
2128
|
+
L: 123,
|
|
2129
|
+
S: this,
|
|
2130
|
+
C: (f, a) => f(...a)
|
|
2131
|
+
});
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
const oldPeers = this._swarmPeers.get(topic);
|
|
2135
|
+
const timestamp = new Date(Date.parse(message.timestamp));
|
|
2136
|
+
const newPeers = new ComplexSet4(PeerInfoHash, payload.peers);
|
|
2137
|
+
for (const peer of newPeers) {
|
|
2138
|
+
if (oldPeers.has(peer)) {
|
|
2139
|
+
continue;
|
|
2140
|
+
}
|
|
2141
|
+
this.swarmEvent.emit({
|
|
2142
|
+
topic,
|
|
2143
|
+
peerAvailable: {
|
|
2144
|
+
peer,
|
|
2145
|
+
since: timestamp
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
for (const peer of oldPeers) {
|
|
2150
|
+
if (newPeers.has(peer)) {
|
|
2151
|
+
continue;
|
|
2152
|
+
}
|
|
2153
|
+
this.swarmEvent.emit({
|
|
2154
|
+
topic,
|
|
2155
|
+
peerLeft: {
|
|
2156
|
+
peer
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
this._swarmPeers.set(topic, newPeers);
|
|
2161
|
+
}
|
|
2162
|
+
_processMessage(message) {
|
|
2163
|
+
invariant6(protocol.getPayloadType(message) === AnySchema.typeName, "Wrong payload type", {
|
|
2164
|
+
F: __dxlog_file7,
|
|
2165
|
+
L: 156,
|
|
2166
|
+
S: this,
|
|
2167
|
+
A: [
|
|
2168
|
+
"protocol.getPayloadType(message) === AnySchema.typeName",
|
|
2169
|
+
"'Wrong payload type'"
|
|
2170
|
+
]
|
|
2171
|
+
});
|
|
2172
|
+
const payload = protocol.getPayload(message, AnySchema);
|
|
2173
|
+
invariant6(message.source, "source is missing", {
|
|
2174
|
+
F: __dxlog_file7,
|
|
2175
|
+
L: 158,
|
|
2176
|
+
S: this,
|
|
2177
|
+
A: [
|
|
2178
|
+
"message.source",
|
|
2179
|
+
"'source is missing'"
|
|
2180
|
+
]
|
|
2181
|
+
});
|
|
2182
|
+
invariant6(message.target, "target is missing", {
|
|
2183
|
+
F: __dxlog_file7,
|
|
2184
|
+
L: 159,
|
|
2185
|
+
S: this,
|
|
2186
|
+
A: [
|
|
2187
|
+
"message.target",
|
|
2188
|
+
"'target is missing'"
|
|
2189
|
+
]
|
|
2190
|
+
});
|
|
2191
|
+
invariant6(message.target.length === 1, "target should have exactly one item", {
|
|
2192
|
+
F: __dxlog_file7,
|
|
2193
|
+
L: 160,
|
|
2194
|
+
S: this,
|
|
2195
|
+
A: [
|
|
2196
|
+
"message.target.length === 1",
|
|
2197
|
+
"'target should have exactly one item'"
|
|
2198
|
+
]
|
|
2199
|
+
});
|
|
2200
|
+
this.onMessage.emit({
|
|
2201
|
+
author: message.source,
|
|
2202
|
+
recipient: message.target[0],
|
|
2203
|
+
payload: {
|
|
2204
|
+
type_url: payload.typeUrl,
|
|
2205
|
+
value: payload.value
|
|
2206
|
+
}
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
_matchSelfPeerInfo(peer) {
|
|
2210
|
+
return peer && (peer.peerKey === this._edgeConnection.deviceKey.toHex() || peer.identityKey === this._edgeConnection.identityKey.toHex());
|
|
2211
|
+
}
|
|
2212
|
+
};
|
|
2213
|
+
|
|
2214
|
+
// packages/core/mesh/messaging/src/signal-manager/utils.ts
|
|
2215
|
+
import { invariant as invariant7 } from "@dxos/invariant";
|
|
2216
|
+
import { log as log8 } from "@dxos/log";
|
|
1952
2217
|
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
1953
|
-
var
|
|
2218
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/messaging/src/signal-manager/utils.ts";
|
|
1954
2219
|
var setIdentityTags = ({ identityService, devicesService, setTag }) => {
|
|
1955
2220
|
identityService.queryIdentity().subscribe((idqr) => {
|
|
1956
2221
|
if (!idqr?.identity?.identityKey) {
|
|
1957
|
-
|
|
2222
|
+
log8("empty response from identity service", {
|
|
1958
2223
|
idqr
|
|
1959
2224
|
}, {
|
|
1960
|
-
F:
|
|
2225
|
+
F: __dxlog_file8,
|
|
1961
2226
|
L: 21,
|
|
1962
2227
|
S: void 0,
|
|
1963
2228
|
C: (f, a) => f(...a)
|
|
@@ -1968,18 +2233,18 @@ var setIdentityTags = ({ identityService, devicesService, setTag }) => {
|
|
|
1968
2233
|
});
|
|
1969
2234
|
devicesService.queryDevices().subscribe((dqr) => {
|
|
1970
2235
|
if (!dqr || !dqr.devices || dqr.devices.length === 0) {
|
|
1971
|
-
|
|
2236
|
+
log8("empty response from device service", {
|
|
1972
2237
|
device: dqr
|
|
1973
2238
|
}, {
|
|
1974
|
-
F:
|
|
2239
|
+
F: __dxlog_file8,
|
|
1975
2240
|
L: 30,
|
|
1976
2241
|
S: void 0,
|
|
1977
2242
|
C: (f, a) => f(...a)
|
|
1978
2243
|
});
|
|
1979
2244
|
return;
|
|
1980
2245
|
}
|
|
1981
|
-
|
|
1982
|
-
F:
|
|
2246
|
+
invariant7(dqr, "empty response from device service", {
|
|
2247
|
+
F: __dxlog_file8,
|
|
1983
2248
|
L: 33,
|
|
1984
2249
|
S: void 0,
|
|
1985
2250
|
A: [
|
|
@@ -1989,10 +2254,10 @@ var setIdentityTags = ({ identityService, devicesService, setTag }) => {
|
|
|
1989
2254
|
});
|
|
1990
2255
|
const thisDevice = dqr.devices.find((device) => device.kind === DeviceKind.CURRENT);
|
|
1991
2256
|
if (!thisDevice) {
|
|
1992
|
-
|
|
2257
|
+
log8("no current device", {
|
|
1993
2258
|
device: dqr
|
|
1994
2259
|
}, {
|
|
1995
|
-
F:
|
|
2260
|
+
F: __dxlog_file8,
|
|
1996
2261
|
L: 37,
|
|
1997
2262
|
S: void 0,
|
|
1998
2263
|
C: (f, a) => f(...a)
|
|
@@ -2003,9 +2268,11 @@ var setIdentityTags = ({ identityService, devicesService, setTag }) => {
|
|
|
2003
2268
|
});
|
|
2004
2269
|
};
|
|
2005
2270
|
export {
|
|
2271
|
+
EdgeSignalManager,
|
|
2006
2272
|
MemorySignalManager,
|
|
2007
2273
|
MemorySignalManagerContext,
|
|
2008
2274
|
Messenger,
|
|
2275
|
+
PeerInfoHash,
|
|
2009
2276
|
SignalClient,
|
|
2010
2277
|
WebsocketSignalManager,
|
|
2011
2278
|
setIdentityTags
|