@dxos/teleport-extension-gossip 0.3.8-next.f4e0086 → 0.3.8
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.
|
@@ -12,7 +12,7 @@ import { invariant } from "@dxos/invariant";
|
|
|
12
12
|
import { log } from "@dxos/log";
|
|
13
13
|
import { schema } from "@dxos/protocols";
|
|
14
14
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
15
|
-
var __dxlog_file = "/home/
|
|
15
|
+
var __dxlog_file = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts";
|
|
16
16
|
var GossipExtension = class {
|
|
17
17
|
constructor(_callbacks = {}) {
|
|
18
18
|
this._callbacks = _callbacks;
|
|
@@ -115,7 +115,7 @@ var GossipExtension = class {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
// packages/core/mesh/teleport-extension-gossip/src/gossip.ts
|
|
118
|
-
var __dxlog_file2 = "/home/
|
|
118
|
+
var __dxlog_file2 = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/gossip.ts";
|
|
119
119
|
var RECEIVED_MESSAGES_GC_INTERVAL = 12e4;
|
|
120
120
|
var YJS_CHANNEL_PREFIX = "user-channel/yjs.awareness";
|
|
121
121
|
var YJS_TIMEOUT_THRESHOLD = 20;
|
|
@@ -334,7 +334,7 @@ import { invariant as invariant2 } from "@dxos/invariant";
|
|
|
334
334
|
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
335
335
|
import { log as log3 } from "@dxos/log";
|
|
336
336
|
import { ComplexMap as ComplexMap2 } from "@dxos/util";
|
|
337
|
-
var __dxlog_file3 = "/home/
|
|
337
|
+
var __dxlog_file3 = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/presence.ts";
|
|
338
338
|
var PRESENCE_CHANNEL_ID = "dxos.mesh.presence.Presence";
|
|
339
339
|
var Presence = class {
|
|
340
340
|
// remotePeerId -> PresenceExtension
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytes":9930,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/gossip.ts":{"bytes":26035,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts","kind":"import-statement","original":"./gossip-extension"}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/presence.ts":{"bytes":13151,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/index.ts":{"bytes":673,"imports":[{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip.ts","kind":"import-statement","original":"./gossip"},{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts","kind":"import-statement","original":"./gossip-extension"},{"path":"packages/core/mesh/teleport-extension-gossip/src/presence.ts","kind":"import-statement","original":"./presence"}],"format":"esm"}},"outputs":{"packages/core/mesh/teleport-extension-gossip/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23361},"packages/core/mesh/teleport-extension-gossip/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Gossip","GossipExtension","Presence"],"entryPoint":"packages/core/mesh/teleport-extension-gossip/src/index.ts","inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip.ts":{"bytesInOutput":6933},"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytesInOutput":2668},"packages/core/mesh/teleport-extension-gossip/src/index.ts":{"bytesInOutput":0},"packages/core/mesh/teleport-extension-gossip/src/presence.ts":{"bytesInOutput":3170}},"bytes":13121}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -16,39 +16,39 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
19
|
+
var node_exports = {};
|
|
20
|
+
__export(node_exports, {
|
|
23
21
|
Gossip: () => Gossip,
|
|
24
22
|
GossipExtension: () => GossipExtension,
|
|
25
23
|
Presence: () => Presence
|
|
26
24
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
-
|
|
29
|
-
// packages/core/mesh/teleport-extension-gossip/src/gossip.ts
|
|
30
|
-
var import_async2 = require("@dxos/async");
|
|
25
|
+
module.exports = __toCommonJS(node_exports);
|
|
26
|
+
var import_async = require("@dxos/async");
|
|
31
27
|
var import_context = require("@dxos/context");
|
|
32
28
|
var import_keys = require("@dxos/keys");
|
|
33
|
-
var import_log2 = require("@dxos/log");
|
|
34
|
-
var import_protocols2 = require("@dxos/protocols");
|
|
35
|
-
var import_util = require("@dxos/util");
|
|
36
|
-
|
|
37
|
-
// packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts
|
|
38
|
-
var import_async = require("@dxos/async");
|
|
39
|
-
var import_invariant = require("@dxos/invariant");
|
|
40
29
|
var import_log = require("@dxos/log");
|
|
41
30
|
var import_protocols = require("@dxos/protocols");
|
|
31
|
+
var import_util = require("@dxos/util");
|
|
32
|
+
var import_async2 = require("@dxos/async");
|
|
33
|
+
var import_invariant = require("@dxos/invariant");
|
|
34
|
+
var import_log2 = require("@dxos/log");
|
|
35
|
+
var import_protocols2 = require("@dxos/protocols");
|
|
42
36
|
var import_rpc = require("@dxos/rpc");
|
|
43
|
-
var
|
|
37
|
+
var import_async3 = require("@dxos/async");
|
|
38
|
+
var import_context2 = require("@dxos/context");
|
|
39
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
40
|
+
var import_keys2 = require("@dxos/keys");
|
|
41
|
+
var import_log3 = require("@dxos/log");
|
|
42
|
+
var import_util2 = require("@dxos/util");
|
|
43
|
+
var __dxlog_file = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts";
|
|
44
44
|
var GossipExtension = class {
|
|
45
45
|
constructor(_callbacks = {}) {
|
|
46
46
|
this._callbacks = _callbacks;
|
|
47
|
-
this._opened = new
|
|
47
|
+
this._opened = new import_async2.Trigger();
|
|
48
48
|
this._closed = false;
|
|
49
49
|
}
|
|
50
50
|
async onOpen(context) {
|
|
51
|
-
(0,
|
|
51
|
+
(0, import_log2.log)("onOpen", {
|
|
52
52
|
localPeerId: context.localPeerId,
|
|
53
53
|
remotePeerId: context.remotePeerId
|
|
54
54
|
}, {
|
|
@@ -59,15 +59,15 @@ var GossipExtension = class {
|
|
|
59
59
|
});
|
|
60
60
|
this._rpc = (0, import_rpc.createProtoRpcPeer)({
|
|
61
61
|
requested: {
|
|
62
|
-
GossipService:
|
|
62
|
+
GossipService: import_protocols2.schema.getService("dxos.mesh.teleport.gossip.GossipService")
|
|
63
63
|
},
|
|
64
64
|
exposed: {
|
|
65
|
-
GossipService:
|
|
65
|
+
GossipService: import_protocols2.schema.getService("dxos.mesh.teleport.gossip.GossipService")
|
|
66
66
|
},
|
|
67
67
|
handlers: {
|
|
68
68
|
GossipService: {
|
|
69
69
|
announce: async (message) => {
|
|
70
|
-
(0,
|
|
70
|
+
(0, import_log2.log)("received announce", {
|
|
71
71
|
localPeerId: context.localPeerId,
|
|
72
72
|
remotePeerId: context.remotePeerId,
|
|
73
73
|
message
|
|
@@ -89,7 +89,7 @@ var GossipExtension = class {
|
|
|
89
89
|
this._opened.wake();
|
|
90
90
|
}
|
|
91
91
|
async onClose(err) {
|
|
92
|
-
(0,
|
|
92
|
+
(0, import_log2.log)("close", {
|
|
93
93
|
err
|
|
94
94
|
}, {
|
|
95
95
|
F: __dxlog_file,
|
|
@@ -102,7 +102,7 @@ var GossipExtension = class {
|
|
|
102
102
|
this._closed = true;
|
|
103
103
|
}
|
|
104
104
|
async onAbort(err) {
|
|
105
|
-
(0,
|
|
105
|
+
(0, import_log2.log)("abort", {
|
|
106
106
|
err
|
|
107
107
|
}, {
|
|
108
108
|
F: __dxlog_file,
|
|
@@ -113,7 +113,7 @@ var GossipExtension = class {
|
|
|
113
113
|
try {
|
|
114
114
|
await this._rpc?.abort();
|
|
115
115
|
} catch (err2) {
|
|
116
|
-
|
|
116
|
+
import_log2.log.catch(err2, void 0, {
|
|
117
117
|
F: __dxlog_file,
|
|
118
118
|
L: 72,
|
|
119
119
|
S: this,
|
|
@@ -141,9 +141,7 @@ var GossipExtension = class {
|
|
|
141
141
|
await this._rpc.rpc.GossipService.announce(message);
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
-
|
|
145
|
-
// packages/core/mesh/teleport-extension-gossip/src/gossip.ts
|
|
146
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport-extension-gossip/src/gossip.ts";
|
|
144
|
+
var __dxlog_file2 = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/gossip.ts";
|
|
147
145
|
var RECEIVED_MESSAGES_GC_INTERVAL = 12e4;
|
|
148
146
|
var YJS_CHANNEL_PREFIX = "user-channel/yjs.awareness";
|
|
149
147
|
var YJS_TIMEOUT_THRESHOLD = 20;
|
|
@@ -154,7 +152,7 @@ var Gossip = class {
|
|
|
154
152
|
this._params = _params;
|
|
155
153
|
this._ctx = new import_context.Context({
|
|
156
154
|
onError: (err) => {
|
|
157
|
-
|
|
155
|
+
import_log.log.catch(err, void 0, {
|
|
158
156
|
F: __dxlog_file2,
|
|
159
157
|
L: 35,
|
|
160
158
|
S: this,
|
|
@@ -166,7 +164,7 @@ var Gossip = class {
|
|
|
166
164
|
this._receivedMessages = new import_util.ComplexSet(import_keys.PublicKey.hash);
|
|
167
165
|
this._toClear = new import_util.ComplexSet(import_keys.PublicKey.hash);
|
|
168
166
|
this._connections = new import_util.ComplexMap(import_keys.PublicKey.hash);
|
|
169
|
-
this.connectionClosed = new
|
|
167
|
+
this.connectionClosed = new import_async.Event();
|
|
170
168
|
this._yjs_timeout = new Array(YJS_TIMEOUT_THRESHOLD);
|
|
171
169
|
this._yjs_timeout_index = 0;
|
|
172
170
|
}
|
|
@@ -174,7 +172,7 @@ var Gossip = class {
|
|
|
174
172
|
return this._params.localPeerId;
|
|
175
173
|
}
|
|
176
174
|
async open() {
|
|
177
|
-
(0,
|
|
175
|
+
(0, import_async.scheduleTaskInterval)(this._ctx, async () => {
|
|
178
176
|
this._performGc();
|
|
179
177
|
}, RECEIVED_MESSAGES_GC_INTERVAL);
|
|
180
178
|
}
|
|
@@ -193,7 +191,7 @@ var Gossip = class {
|
|
|
193
191
|
this._receivedMessages.add(message.messageId);
|
|
194
192
|
this._callListeners(message);
|
|
195
193
|
if (message.channelId.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {
|
|
196
|
-
(0,
|
|
194
|
+
(0, import_log.log)(`skipping propagating YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${YJS_TIMEOUT_WINDOW / 1e3})`, void 0, {
|
|
197
195
|
F: __dxlog_file2,
|
|
198
196
|
L: 91,
|
|
199
197
|
S: this,
|
|
@@ -202,7 +200,7 @@ var Gossip = class {
|
|
|
202
200
|
return;
|
|
203
201
|
}
|
|
204
202
|
if (this._ctx.disposeCallbacksLength > MAX_CTX_TASKS) {
|
|
205
|
-
(0,
|
|
203
|
+
(0, import_log.log)(`skipping propagating YJS gossip message due to exessive tasks (${MAX_CTX_TASKS})`, void 0, {
|
|
206
204
|
F: __dxlog_file2,
|
|
207
205
|
L: 99,
|
|
208
206
|
S: this,
|
|
@@ -210,13 +208,13 @@ var Gossip = class {
|
|
|
210
208
|
});
|
|
211
209
|
return;
|
|
212
210
|
}
|
|
213
|
-
(0,
|
|
211
|
+
(0, import_async.scheduleTask)(this._ctx, async () => {
|
|
214
212
|
await this._propagateAnnounce(message);
|
|
215
213
|
});
|
|
216
214
|
},
|
|
217
215
|
onClose: async (err) => {
|
|
218
216
|
if (err) {
|
|
219
|
-
|
|
217
|
+
import_log.log.catch(err, void 0, {
|
|
220
218
|
F: __dxlog_file2,
|
|
221
219
|
L: 108,
|
|
222
220
|
S: this,
|
|
@@ -234,7 +232,7 @@ var Gossip = class {
|
|
|
234
232
|
}
|
|
235
233
|
postMessage(channel, payload) {
|
|
236
234
|
if (channel.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {
|
|
237
|
-
(0,
|
|
235
|
+
(0, import_log.log)(`skipping YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${YJS_TIMEOUT_WINDOW / 1e3}s )`, void 0, {
|
|
238
236
|
F: __dxlog_file2,
|
|
239
237
|
L: 123,
|
|
240
238
|
S: this,
|
|
@@ -250,8 +248,8 @@ var Gossip = class {
|
|
|
250
248
|
timestamp: /* @__PURE__ */ new Date(),
|
|
251
249
|
payload
|
|
252
250
|
}).catch(async (err) => {
|
|
253
|
-
if (err instanceof
|
|
254
|
-
(0,
|
|
251
|
+
if (err instanceof import_protocols.RpcClosedError) {
|
|
252
|
+
(0, import_log.log)("sendAnnounce failed because of RpcClosedError", {
|
|
255
253
|
err
|
|
256
254
|
}, {
|
|
257
255
|
F: __dxlog_file2,
|
|
@@ -259,8 +257,8 @@ var Gossip = class {
|
|
|
259
257
|
S: this,
|
|
260
258
|
C: (f, a) => f(...a)
|
|
261
259
|
});
|
|
262
|
-
} else if (err instanceof
|
|
263
|
-
(0,
|
|
260
|
+
} else if (err instanceof import_protocols.TimeoutError || err.constructor.name === "TimeoutError" || err.message.startsWith("Timeout")) {
|
|
261
|
+
(0, import_log.log)("sendAnnounce failed because of TimeoutError", {
|
|
264
262
|
err
|
|
265
263
|
}, {
|
|
266
264
|
F: __dxlog_file2,
|
|
@@ -269,7 +267,7 @@ var Gossip = class {
|
|
|
269
267
|
C: (f, a) => f(...a)
|
|
270
268
|
});
|
|
271
269
|
} else {
|
|
272
|
-
|
|
270
|
+
import_log.log.catch(err, void 0, {
|
|
273
271
|
F: __dxlog_file2,
|
|
274
272
|
L: 147,
|
|
275
273
|
S: this,
|
|
@@ -304,7 +302,7 @@ var Gossip = class {
|
|
|
304
302
|
if (this._params.localPeerId.equals(message.peerId) || remotePeerId.equals(message.peerId)) {
|
|
305
303
|
return;
|
|
306
304
|
}
|
|
307
|
-
return this._sendAnnounceWithTimeoutTracking(extension, message).catch((err) => (0,
|
|
305
|
+
return this._sendAnnounceWithTimeoutTracking(extension, message).catch((err) => (0, import_log.log)(err, void 0, {
|
|
308
306
|
F: __dxlog_file2,
|
|
309
307
|
L: 180,
|
|
310
308
|
S: this,
|
|
@@ -323,7 +321,7 @@ var Gossip = class {
|
|
|
323
321
|
}
|
|
324
322
|
const elapsed = performance.now() - start;
|
|
325
323
|
if (elapsed > 100) {
|
|
326
|
-
|
|
324
|
+
import_log.log.warn("GC took too long", {
|
|
327
325
|
elapsed
|
|
328
326
|
}, {
|
|
329
327
|
F: __dxlog_file2,
|
|
@@ -346,7 +344,7 @@ var Gossip = class {
|
|
|
346
344
|
}
|
|
347
345
|
_sendAnnounceWithTimeoutTracking(extension, message) {
|
|
348
346
|
return extension.sendAnnounce(message).catch((err) => {
|
|
349
|
-
if (err instanceof
|
|
347
|
+
if (err instanceof import_protocols.TimeoutError || err.constructor.name === "TimeoutError" || err.message.startsWith("Timeout")) {
|
|
350
348
|
if (message.channelId.startsWith(YJS_CHANNEL_PREFIX)) {
|
|
351
349
|
this._addYjsTimeout();
|
|
352
350
|
}
|
|
@@ -354,15 +352,7 @@ var Gossip = class {
|
|
|
354
352
|
});
|
|
355
353
|
}
|
|
356
354
|
};
|
|
357
|
-
|
|
358
|
-
// packages/core/mesh/teleport-extension-gossip/src/presence.ts
|
|
359
|
-
var import_async3 = require("@dxos/async");
|
|
360
|
-
var import_context2 = require("@dxos/context");
|
|
361
|
-
var import_invariant2 = require("@dxos/invariant");
|
|
362
|
-
var import_keys2 = require("@dxos/keys");
|
|
363
|
-
var import_log3 = require("@dxos/log");
|
|
364
|
-
var import_util2 = require("@dxos/util");
|
|
365
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport-extension-gossip/src/presence.ts";
|
|
355
|
+
var __dxlog_file3 = "/home/circleci/project/packages/core/mesh/teleport-extension-gossip/src/presence.ts";
|
|
366
356
|
var PRESENCE_CHANNEL_ID = "dxos.mesh.presence.Presence";
|
|
367
357
|
var Presence = class {
|
|
368
358
|
// remotePeerId -> PresenceExtension
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nexport * from './gossip';\nexport * from './gossip-extension';\nexport * from './presence';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { scheduleTask, Event, scheduleTaskInterval } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { RpcClosedError, TimeoutError } from '@dxos/protocols';\nimport { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { ComplexMap, ComplexSet } from '@dxos/util';\n\nimport { GossipExtension } from './gossip-extension';\n\nexport type GossipParams = {\n localPeerId: PublicKey;\n};\n\nconst RECEIVED_MESSAGES_GC_INTERVAL = 120_000;\n\nconst YJS_CHANNEL_PREFIX = 'user-channel/yjs.awareness';\nconst YJS_TIMEOUT_THRESHOLD = 20;\nconst YJS_TIMEOUT_WINDOW = 1000 * 30;\nconst MAX_CTX_TASKS = 50;\n\n/**\n * Gossip extensions manager.\n * Keeps track of all peers that are connected to the local peer.\n * Routes received announces to all connected peers.\n * Exposes API send announce to everybody and subscribe to .\n */\nexport class Gossip {\n private readonly _ctx = new Context({\n onError: (err) => {\n log.catch(err);\n },\n });\n\n private readonly _listeners = new Map<string, Set<(message: GossipMessage) => void>>();\n\n private readonly _receivedMessages = new ComplexSet<PublicKey>(PublicKey.hash);\n\n /**\n * Keys scheduled to be cleared from _receivedMessages on the next iteration.\n */\n private readonly _toClear = new ComplexSet<PublicKey>(PublicKey.hash);\n\n // remotePeerId -> PresenceExtension\n private readonly _connections = new ComplexMap<PublicKey, GossipExtension>(PublicKey.hash);\n\n public readonly connectionClosed = new Event<PublicKey>();\n\n // ringbuffer for yjs timeouts\n private _yjs_timeout = new Array(YJS_TIMEOUT_THRESHOLD);\n private _yjs_timeout_index = 0;\n\n constructor(private readonly _params: GossipParams) {}\n\n get localPeerId() {\n return this._params.localPeerId;\n }\n\n async open() {\n // Clear the map periodically.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n this._performGc();\n },\n RECEIVED_MESSAGES_GC_INTERVAL,\n );\n }\n\n async close() {\n await this._ctx.dispose();\n }\n\n getConnections() {\n return Array.from(this._connections.keys());\n }\n\n createExtension({ remotePeerId }: { remotePeerId: PublicKey }): GossipExtension {\n const extension = new GossipExtension({\n onAnnounce: async (message) => {\n if (this._receivedMessages.has(message.messageId)) {\n return;\n }\n this._receivedMessages.add(message.messageId);\n this._callListeners(message);\n if (message.channelId.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {\n log(\n `skipping propagating YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${\n YJS_TIMEOUT_WINDOW / 1000\n })`,\n );\n return;\n }\n if (this._ctx.disposeCallbacksLength > MAX_CTX_TASKS) {\n log(`skipping propagating YJS gossip message due to exessive tasks (${MAX_CTX_TASKS})`);\n return;\n }\n scheduleTask(this._ctx, async () => {\n await this._propagateAnnounce(message);\n });\n },\n onClose: async (err) => {\n if (err) {\n log.catch(err);\n }\n if (this._connections.has(remotePeerId)) {\n this._connections.delete(remotePeerId);\n }\n this.connectionClosed.emit(remotePeerId);\n },\n });\n this._connections.set(remotePeerId, extension);\n\n return extension;\n }\n\n postMessage(channel: string, payload: any) {\n if (channel.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {\n log(\n `skipping YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${\n YJS_TIMEOUT_WINDOW / 1000\n }s )`,\n );\n return;\n }\n for (const extension of this._connections.values()) {\n this._sendAnnounceWithTimeoutTracking(extension, {\n peerId: this._params.localPeerId,\n messageId: PublicKey.random(),\n channelId: channel,\n timestamp: new Date(),\n payload,\n }).catch(async (err) => {\n if (err instanceof RpcClosedError) {\n log('sendAnnounce failed because of RpcClosedError', { err });\n } else if (\n err instanceof TimeoutError ||\n err.constructor.name === 'TimeoutError' ||\n err.message.startsWith('Timeout')\n ) {\n log('sendAnnounce failed because of TimeoutError', { err });\n } else {\n log.catch(err);\n }\n });\n }\n }\n\n listen(channel: string, callback: (message: GossipMessage) => void) {\n if (!this._listeners.has(channel)) {\n this._listeners.set(channel, new Set());\n }\n this._listeners.get(channel)!.add(callback);\n\n return {\n unsubscribe: () => {\n this._listeners.get(channel)!.delete(callback);\n },\n };\n }\n\n private _callListeners(message: GossipMessage) {\n if (this._listeners.has(message.channelId)) {\n this._listeners.get(message.channelId)!.forEach((callback) => {\n callback(message);\n });\n }\n }\n\n private _propagateAnnounce(message: GossipMessage) {\n return Promise.all(\n [...this._connections.entries()].map(async ([remotePeerId, extension]) => {\n if (this._params.localPeerId.equals(message.peerId) || remotePeerId.equals(message.peerId)) {\n return;\n }\n return this._sendAnnounceWithTimeoutTracking(extension, message).catch((err) => log(err));\n }),\n );\n }\n\n private _performGc() {\n const start = performance.now();\n\n for (const key of this._toClear.keys()) {\n this._receivedMessages.delete(key);\n }\n this._toClear.clear();\n for (const key of this._receivedMessages.keys()) {\n this._toClear.add(key);\n }\n\n const elapsed = performance.now() - start;\n if (elapsed > 100) {\n log.warn('GC took too long', { elapsed });\n }\n }\n\n private _addYjsTimeout() {\n this._yjs_timeout[this._yjs_timeout_index] = Date.now();\n this._yjs_timeout_index = (this._yjs_timeout_index + 1) % YJS_TIMEOUT_THRESHOLD;\n }\n\n private _oldestYjsTimeoutInWindow(): boolean {\n const lastTS = this._yjs_timeout[(this._yjs_timeout_index + 1) % YJS_TIMEOUT_THRESHOLD];\n if (!lastTS) {\n return false;\n }\n\n return Date.now() - lastTS < YJS_TIMEOUT_WINDOW;\n }\n\n private _sendAnnounceWithTimeoutTracking(extension: GossipExtension, message: GossipMessage) {\n return extension.sendAnnounce(message).catch((err) => {\n if (err instanceof TimeoutError || err.constructor.name === 'TimeoutError' || err.message.startsWith('Timeout')) {\n if (message.channelId.startsWith(YJS_CHANNEL_PREFIX)) {\n this._addYjsTimeout();\n }\n }\n });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { schema } from '@dxos/protocols';\nimport { type GossipMessage, type GossipService } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { createProtoRpcPeer, type ProtoRpcPeer } from '@dxos/rpc';\nimport { type ExtensionContext, type TeleportExtension } from '@dxos/teleport';\n\nexport type GossipCallbacks = {\n /**\n * Callback to be called when a new announce is received.\n */\n onAnnounce?: (message: GossipMessage) => Promise<void>;\n\n /**\n * Callback to be called when the extension is closed.\n */\n onClose?: (err?: Error) => Promise<void>;\n};\n\n/**\n * Sends announces between two peers for a single teleport session.\n */\nexport class GossipExtension implements TeleportExtension {\n private readonly _opened = new Trigger();\n private _closed = false;\n\n private _rpc?: ProtoRpcPeer<ServiceBundle>;\n\n constructor(private readonly _callbacks: GossipCallbacks = {}) {}\n\n async onOpen(context: ExtensionContext): Promise<void> {\n log('onOpen', { localPeerId: context.localPeerId, remotePeerId: context.remotePeerId });\n\n this._rpc = createProtoRpcPeer<ServiceBundle, ServiceBundle>({\n requested: {\n GossipService: schema.getService('dxos.mesh.teleport.gossip.GossipService'),\n },\n exposed: {\n GossipService: schema.getService('dxos.mesh.teleport.gossip.GossipService'),\n },\n handlers: {\n GossipService: {\n announce: async (message: GossipMessage) => {\n log('received announce', { localPeerId: context.localPeerId, remotePeerId: context.remotePeerId, message });\n await this._callbacks.onAnnounce?.(message);\n },\n },\n },\n port: await context.createPort('rpc', { contentType: 'application/x-protobuf; messageType=\"dxos.rpc.Message\"' }),\n });\n await this._rpc.open();\n this._opened.wake();\n }\n\n async onClose(err?: Error): Promise<void> {\n log('close', { err });\n await this._rpc?.close();\n await this._callbacks.onClose?.(err);\n this._closed = true;\n }\n\n async onAbort(err?: Error): Promise<void> {\n log('abort', { err });\n try {\n await this._rpc?.abort();\n } catch (err) {\n log.catch(err);\n } finally {\n await this._callbacks.onClose?.(err);\n }\n this._closed = true;\n }\n\n async sendAnnounce(message: GossipMessage) {\n if (this._closed) {\n return;\n }\n await this._opened.wait();\n invariant(this._rpc, 'RPC not initialized');\n await this._rpc.rpc.GossipService.announce(message);\n }\n}\n\ntype ServiceBundle = {\n GossipService: GossipService;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Event, scheduleTaskInterval } from '@dxos/async';\nimport { type WithTypeUrl } from '@dxos/codec-protobuf';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type PeerState } from '@dxos/protocols/proto/dxos/mesh/presence';\nimport { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { ComplexMap } from '@dxos/util';\n\nimport { type Gossip } from './gossip';\n\nexport type PresenceParams = {\n /**\n * Interval between presence announces.\n */\n announceInterval: number;\n /**\n * Timeout after which a peer is considered offline.\n * Should be greater than announceInterval.\n */\n offlineTimeout: number;\n\n /**\n * Identity key of the local peer.\n */\n identityKey: PublicKey; // TODO(mykola): Remove once IdentityKey can be obtained from DeviceKey.\n\n gossip: Gossip;\n};\n\nconst PRESENCE_CHANNEL_ID = 'dxos.mesh.presence.Presence';\n\n/**\n * Presence manager.\n * Keeps track of all peers that are connected to the local peer.\n * Routes received presence announces to all connected peers.\n * Exposes API to get the list of peers that are online.\n */\nexport class Presence {\n public readonly updated = new Event<void>();\n private readonly _ctx = new Context({\n onError: (err) => {\n log.catch(err);\n },\n });\n\n private readonly _peerStates = new ComplexMap<PublicKey, GossipMessage>(PublicKey.hash);\n\n // remotePeerId -> PresenceExtension\n\n constructor(private readonly _params: PresenceParams) {\n invariant(\n this._params.announceInterval < this._params.offlineTimeout,\n 'Announce interval should be less than offline timeout.',\n );\n\n this._params.gossip.listen(PRESENCE_CHANNEL_ID, (message) => {\n this._receiveAnnounces(message);\n });\n\n // Send announce to all connected peers.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n const peerState: WithTypeUrl<PeerState> = {\n '@type': 'dxos.mesh.presence.PeerState',\n identityKey: this._params.identityKey,\n connections: this._params.gossip.getConnections(),\n };\n await this._params.gossip.postMessage(PRESENCE_CHANNEL_ID, peerState);\n },\n _params.announceInterval,\n );\n\n // Emit updated event in case some peers went offline.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n this.updated.emit();\n },\n _params.offlineTimeout,\n );\n\n // Remove peer state when connection is closed.\n this._params.gossip.connectionClosed.on((peerId) => {\n this._peerStates.delete(peerId);\n this.updated.emit();\n });\n }\n\n getPeers(): PeerState[] {\n return Array.from(this._peerStates.values()).map((message) => message.payload);\n }\n\n getPeersOnline(): PeerState[] {\n return Array.from(this._peerStates.values())\n .filter((message) => message.timestamp.getTime() > Date.now() - this._params.offlineTimeout)\n .map((message) => message.payload);\n }\n\n getLocalState(): PeerState {\n return {\n identityKey: this._params.identityKey,\n connections: this._params.gossip.getConnections(),\n peerId: this._params.gossip.localPeerId,\n };\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n\n private _receiveAnnounces(message: GossipMessage) {\n invariant(message.channelId === PRESENCE_CHANNEL_ID, `Invalid channel ID: ${message.channelId}`);\n const oldPeerState = this._peerStates.get(message.peerId);\n if (!oldPeerState || oldPeerState.timestamp.getTime() < message.timestamp.getTime()) {\n // Assign peer id to payload.\n (message.payload as PeerState).peerId = message.peerId;\n\n this._peerStates.set(message.peerId, message);\n this.updated.emit();\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_async", "import_log", "import_protocols", "GossipExtension", "constructor", "_callbacks", "_opened", "Trigger", "_closed", "onOpen", "context", "log", "localPeerId", "remotePeerId", "_rpc", "createProtoRpcPeer", "requested", "GossipService", "schema", "getService", "exposed", "handlers", "announce", "message", "onAnnounce", "port", "createPort", "contentType", "open", "wake", "onClose", "err", "close", "onAbort", "abort", "catch", "sendAnnounce", "wait", "invariant", "rpc", "RECEIVED_MESSAGES_GC_INTERVAL", "YJS_CHANNEL_PREFIX", "YJS_TIMEOUT_THRESHOLD", "YJS_TIMEOUT_WINDOW", "MAX_CTX_TASKS", "Gossip", "
|
|
3
|
+
"sources": ["../../../src/gossip.ts", "../../../src/gossip-extension.ts", "../../../src/presence.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { scheduleTask, Event, scheduleTaskInterval } from '@dxos/async';\nimport { Context } from '@dxos/context';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { RpcClosedError, TimeoutError } from '@dxos/protocols';\nimport { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { ComplexMap, ComplexSet } from '@dxos/util';\n\nimport { GossipExtension } from './gossip-extension';\n\nexport type GossipParams = {\n localPeerId: PublicKey;\n};\n\nconst RECEIVED_MESSAGES_GC_INTERVAL = 120_000;\n\nconst YJS_CHANNEL_PREFIX = 'user-channel/yjs.awareness';\nconst YJS_TIMEOUT_THRESHOLD = 20;\nconst YJS_TIMEOUT_WINDOW = 1000 * 30;\nconst MAX_CTX_TASKS = 50;\n\n/**\n * Gossip extensions manager.\n * Keeps track of all peers that are connected to the local peer.\n * Routes received announces to all connected peers.\n * Exposes API send announce to everybody and subscribe to .\n */\nexport class Gossip {\n private readonly _ctx = new Context({\n onError: (err) => {\n log.catch(err);\n },\n });\n\n private readonly _listeners = new Map<string, Set<(message: GossipMessage) => void>>();\n\n private readonly _receivedMessages = new ComplexSet<PublicKey>(PublicKey.hash);\n\n /**\n * Keys scheduled to be cleared from _receivedMessages on the next iteration.\n */\n private readonly _toClear = new ComplexSet<PublicKey>(PublicKey.hash);\n\n // remotePeerId -> PresenceExtension\n private readonly _connections = new ComplexMap<PublicKey, GossipExtension>(PublicKey.hash);\n\n public readonly connectionClosed = new Event<PublicKey>();\n\n // ringbuffer for yjs timeouts\n private _yjs_timeout = new Array(YJS_TIMEOUT_THRESHOLD);\n private _yjs_timeout_index = 0;\n\n constructor(private readonly _params: GossipParams) {}\n\n get localPeerId() {\n return this._params.localPeerId;\n }\n\n async open() {\n // Clear the map periodically.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n this._performGc();\n },\n RECEIVED_MESSAGES_GC_INTERVAL,\n );\n }\n\n async close() {\n await this._ctx.dispose();\n }\n\n getConnections() {\n return Array.from(this._connections.keys());\n }\n\n createExtension({ remotePeerId }: { remotePeerId: PublicKey }): GossipExtension {\n const extension = new GossipExtension({\n onAnnounce: async (message) => {\n if (this._receivedMessages.has(message.messageId)) {\n return;\n }\n this._receivedMessages.add(message.messageId);\n this._callListeners(message);\n if (message.channelId.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {\n log(\n `skipping propagating YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${\n YJS_TIMEOUT_WINDOW / 1000\n })`,\n );\n return;\n }\n if (this._ctx.disposeCallbacksLength > MAX_CTX_TASKS) {\n log(`skipping propagating YJS gossip message due to exessive tasks (${MAX_CTX_TASKS})`);\n return;\n }\n scheduleTask(this._ctx, async () => {\n await this._propagateAnnounce(message);\n });\n },\n onClose: async (err) => {\n if (err) {\n log.catch(err);\n }\n if (this._connections.has(remotePeerId)) {\n this._connections.delete(remotePeerId);\n }\n this.connectionClosed.emit(remotePeerId);\n },\n });\n this._connections.set(remotePeerId, extension);\n\n return extension;\n }\n\n postMessage(channel: string, payload: any) {\n if (channel.startsWith(YJS_CHANNEL_PREFIX) && this._oldestYjsTimeoutInWindow()) {\n log(\n `skipping YJS gossip message due to timeouts (>${YJS_TIMEOUT_THRESHOLD} received in ${\n YJS_TIMEOUT_WINDOW / 1000\n }s )`,\n );\n return;\n }\n for (const extension of this._connections.values()) {\n this._sendAnnounceWithTimeoutTracking(extension, {\n peerId: this._params.localPeerId,\n messageId: PublicKey.random(),\n channelId: channel,\n timestamp: new Date(),\n payload,\n }).catch(async (err) => {\n if (err instanceof RpcClosedError) {\n log('sendAnnounce failed because of RpcClosedError', { err });\n } else if (\n err instanceof TimeoutError ||\n err.constructor.name === 'TimeoutError' ||\n err.message.startsWith('Timeout')\n ) {\n log('sendAnnounce failed because of TimeoutError', { err });\n } else {\n log.catch(err);\n }\n });\n }\n }\n\n listen(channel: string, callback: (message: GossipMessage) => void) {\n if (!this._listeners.has(channel)) {\n this._listeners.set(channel, new Set());\n }\n this._listeners.get(channel)!.add(callback);\n\n return {\n unsubscribe: () => {\n this._listeners.get(channel)!.delete(callback);\n },\n };\n }\n\n private _callListeners(message: GossipMessage) {\n if (this._listeners.has(message.channelId)) {\n this._listeners.get(message.channelId)!.forEach((callback) => {\n callback(message);\n });\n }\n }\n\n private _propagateAnnounce(message: GossipMessage) {\n return Promise.all(\n [...this._connections.entries()].map(async ([remotePeerId, extension]) => {\n if (this._params.localPeerId.equals(message.peerId) || remotePeerId.equals(message.peerId)) {\n return;\n }\n return this._sendAnnounceWithTimeoutTracking(extension, message).catch((err) => log(err));\n }),\n );\n }\n\n private _performGc() {\n const start = performance.now();\n\n for (const key of this._toClear.keys()) {\n this._receivedMessages.delete(key);\n }\n this._toClear.clear();\n for (const key of this._receivedMessages.keys()) {\n this._toClear.add(key);\n }\n\n const elapsed = performance.now() - start;\n if (elapsed > 100) {\n log.warn('GC took too long', { elapsed });\n }\n }\n\n private _addYjsTimeout() {\n this._yjs_timeout[this._yjs_timeout_index] = Date.now();\n this._yjs_timeout_index = (this._yjs_timeout_index + 1) % YJS_TIMEOUT_THRESHOLD;\n }\n\n private _oldestYjsTimeoutInWindow(): boolean {\n const lastTS = this._yjs_timeout[(this._yjs_timeout_index + 1) % YJS_TIMEOUT_THRESHOLD];\n if (!lastTS) {\n return false;\n }\n\n return Date.now() - lastTS < YJS_TIMEOUT_WINDOW;\n }\n\n private _sendAnnounceWithTimeoutTracking(extension: GossipExtension, message: GossipMessage) {\n return extension.sendAnnounce(message).catch((err) => {\n if (err instanceof TimeoutError || err.constructor.name === 'TimeoutError' || err.message.startsWith('Timeout')) {\n if (message.channelId.startsWith(YJS_CHANNEL_PREFIX)) {\n this._addYjsTimeout();\n }\n }\n });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { schema } from '@dxos/protocols';\nimport { type GossipMessage, type GossipService } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { createProtoRpcPeer, type ProtoRpcPeer } from '@dxos/rpc';\nimport { type ExtensionContext, type TeleportExtension } from '@dxos/teleport';\n\nexport type GossipCallbacks = {\n /**\n * Callback to be called when a new announce is received.\n */\n onAnnounce?: (message: GossipMessage) => Promise<void>;\n\n /**\n * Callback to be called when the extension is closed.\n */\n onClose?: (err?: Error) => Promise<void>;\n};\n\n/**\n * Sends announces between two peers for a single teleport session.\n */\nexport class GossipExtension implements TeleportExtension {\n private readonly _opened = new Trigger();\n private _closed = false;\n\n private _rpc?: ProtoRpcPeer<ServiceBundle>;\n\n constructor(private readonly _callbacks: GossipCallbacks = {}) {}\n\n async onOpen(context: ExtensionContext): Promise<void> {\n log('onOpen', { localPeerId: context.localPeerId, remotePeerId: context.remotePeerId });\n\n this._rpc = createProtoRpcPeer<ServiceBundle, ServiceBundle>({\n requested: {\n GossipService: schema.getService('dxos.mesh.teleport.gossip.GossipService'),\n },\n exposed: {\n GossipService: schema.getService('dxos.mesh.teleport.gossip.GossipService'),\n },\n handlers: {\n GossipService: {\n announce: async (message: GossipMessage) => {\n log('received announce', { localPeerId: context.localPeerId, remotePeerId: context.remotePeerId, message });\n await this._callbacks.onAnnounce?.(message);\n },\n },\n },\n port: await context.createPort('rpc', { contentType: 'application/x-protobuf; messageType=\"dxos.rpc.Message\"' }),\n });\n await this._rpc.open();\n this._opened.wake();\n }\n\n async onClose(err?: Error): Promise<void> {\n log('close', { err });\n await this._rpc?.close();\n await this._callbacks.onClose?.(err);\n this._closed = true;\n }\n\n async onAbort(err?: Error): Promise<void> {\n log('abort', { err });\n try {\n await this._rpc?.abort();\n } catch (err) {\n log.catch(err);\n } finally {\n await this._callbacks.onClose?.(err);\n }\n this._closed = true;\n }\n\n async sendAnnounce(message: GossipMessage) {\n if (this._closed) {\n return;\n }\n await this._opened.wait();\n invariant(this._rpc, 'RPC not initialized');\n await this._rpc.rpc.GossipService.announce(message);\n }\n}\n\ntype ServiceBundle = {\n GossipService: GossipService;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { Event, scheduleTaskInterval } from '@dxos/async';\nimport { type WithTypeUrl } from '@dxos/codec-protobuf';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { PublicKey } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type PeerState } from '@dxos/protocols/proto/dxos/mesh/presence';\nimport { type GossipMessage } from '@dxos/protocols/proto/dxos/mesh/teleport/gossip';\nimport { ComplexMap } from '@dxos/util';\n\nimport { type Gossip } from './gossip';\n\nexport type PresenceParams = {\n /**\n * Interval between presence announces.\n */\n announceInterval: number;\n /**\n * Timeout after which a peer is considered offline.\n * Should be greater than announceInterval.\n */\n offlineTimeout: number;\n\n /**\n * Identity key of the local peer.\n */\n identityKey: PublicKey; // TODO(mykola): Remove once IdentityKey can be obtained from DeviceKey.\n\n gossip: Gossip;\n};\n\nconst PRESENCE_CHANNEL_ID = 'dxos.mesh.presence.Presence';\n\n/**\n * Presence manager.\n * Keeps track of all peers that are connected to the local peer.\n * Routes received presence announces to all connected peers.\n * Exposes API to get the list of peers that are online.\n */\nexport class Presence {\n public readonly updated = new Event<void>();\n private readonly _ctx = new Context({\n onError: (err) => {\n log.catch(err);\n },\n });\n\n private readonly _peerStates = new ComplexMap<PublicKey, GossipMessage>(PublicKey.hash);\n\n // remotePeerId -> PresenceExtension\n\n constructor(private readonly _params: PresenceParams) {\n invariant(\n this._params.announceInterval < this._params.offlineTimeout,\n 'Announce interval should be less than offline timeout.',\n );\n\n this._params.gossip.listen(PRESENCE_CHANNEL_ID, (message) => {\n this._receiveAnnounces(message);\n });\n\n // Send announce to all connected peers.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n const peerState: WithTypeUrl<PeerState> = {\n '@type': 'dxos.mesh.presence.PeerState',\n identityKey: this._params.identityKey,\n connections: this._params.gossip.getConnections(),\n };\n await this._params.gossip.postMessage(PRESENCE_CHANNEL_ID, peerState);\n },\n _params.announceInterval,\n );\n\n // Emit updated event in case some peers went offline.\n scheduleTaskInterval(\n this._ctx,\n async () => {\n this.updated.emit();\n },\n _params.offlineTimeout,\n );\n\n // Remove peer state when connection is closed.\n this._params.gossip.connectionClosed.on((peerId) => {\n this._peerStates.delete(peerId);\n this.updated.emit();\n });\n }\n\n getPeers(): PeerState[] {\n return Array.from(this._peerStates.values()).map((message) => message.payload);\n }\n\n getPeersOnline(): PeerState[] {\n return Array.from(this._peerStates.values())\n .filter((message) => message.timestamp.getTime() > Date.now() - this._params.offlineTimeout)\n .map((message) => message.payload);\n }\n\n getLocalState(): PeerState {\n return {\n identityKey: this._params.identityKey,\n connections: this._params.gossip.getConnections(),\n peerId: this._params.gossip.localPeerId,\n };\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n\n private _receiveAnnounces(message: GossipMessage) {\n invariant(message.channelId === PRESENCE_CHANNEL_ID, `Invalid channel ID: ${message.channelId}`);\n const oldPeerState = this._peerStates.get(message.peerId);\n if (!oldPeerState || oldPeerState.timestamp.getTime() < message.timestamp.getTime()) {\n // Assign peer id to payload.\n (message.payload as PeerState).peerId = message.peerId;\n\n this._peerStates.set(message.peerId, message);\n this.updated.emit();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAA0D;AAC1D,qBAAwB;AACxB,kBAA0B;AAC1B,iBAAoB;AACpB,uBAA6C;A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C,KAAKiB,IAAG,IAAK,KAAKhE,QAAQ4E,cAAc,EAC1FhB,IAAI,CAACnF,YAAYA,QAAQgE,OAAO;EACrC;EAEA8C,gBAA2B;AACzB,WAAO;MACLP,aAAa,KAAKhF,QAAQgF;MAC1BC,aAAa,KAAKjF,QAAQ6E,OAAOxD,eAAc;MAC/CuB,QAAQ,KAAK5C,QAAQ6E,OAAO/G;IAC9B;EACF;EAEA,MAAM0H,UAAU;AACd,UAAM,KAAKvF,KAAKmB,QAAO;EACzB;EAEQ0D,kBAAkBrG,SAAwB;AAChDe,0BAAAA,WAAUf,QAAQqD,cAAcyC,qBAAqB,uBAAuB9F,QAAQqD,SAAS,IAAE;;;;;;;;;AAC/F,UAAM2D,eAAe,KAAKf,YAAYpB,IAAI7E,QAAQmE,MAAM;AACxD,QAAI,CAAC6C,gBAAgBA,aAAa3C,UAAUwC,QAAO,IAAK7G,QAAQqE,UAAUwC,QAAO,GAAI;AAElF7G,cAAQgE,QAAsBG,SAASnE,QAAQmE;AAEhD,WAAK8B,YAAYpC,IAAI7D,QAAQmE,QAAQnE,OAAAA;AACrC,WAAKgG,QAAQpC,KAAI;IACnB;EACF;AACF;",
|
|
6
|
+
"names": ["import_async", "import_log", "import_protocols", "import_context", "import_invariant", "import_keys", "import_util", "GossipExtension", "constructor", "_callbacks", "_opened", "Trigger", "_closed", "onOpen", "context", "log", "localPeerId", "remotePeerId", "_rpc", "createProtoRpcPeer", "requested", "GossipService", "schema", "getService", "exposed", "handlers", "announce", "message", "onAnnounce", "port", "createPort", "contentType", "open", "wake", "onClose", "err", "close", "onAbort", "abort", "catch", "sendAnnounce", "wait", "invariant", "rpc", "RECEIVED_MESSAGES_GC_INTERVAL", "YJS_CHANNEL_PREFIX", "YJS_TIMEOUT_THRESHOLD", "YJS_TIMEOUT_WINDOW", "MAX_CTX_TASKS", "Gossip", "_params", "_ctx", "Context", "onError", "_listeners", "Map", "_receivedMessages", "ComplexSet", "PublicKey", "hash", "_toClear", "_connections", "ComplexMap", "connectionClosed", "Event", "_yjs_timeout", "Array", "_yjs_timeout_index", "scheduleTaskInterval", "_performGc", "dispose", "getConnections", "from", "keys", "createExtension", "extension", "has", "messageId", "add", "_callListeners", "channelId", "startsWith", "_oldestYjsTimeoutInWindow", "disposeCallbacksLength", "scheduleTask", "_propagateAnnounce", "delete", "emit", "set", "postMessage", "channel", "payload", "values", "_sendAnnounceWithTimeoutTracking", "peerId", "random", "timestamp", "Date", "RpcClosedError", "TimeoutError", "name", "listen", "callback", "Set", "get", "unsubscribe", "forEach", "Promise", "all", "entries", "map", "equals", "start", "performance", "now", "key", "clear", "elapsed", "warn", "_addYjsTimeout", "lastTS", "PRESENCE_CHANNEL_ID", "Presence", "updated", "_peerStates", "announceInterval", "offlineTimeout", "gossip", "_receiveAnnounces", "peerState", "identityKey", "connections", "on", "getPeers", "getPeersOnline", "filter", "getTime", "getLocalState", "destroy", "oldPeerState"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytes":9930,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/gossip.ts":{"bytes":26035,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts","kind":"import-statement","original":"./gossip-extension"}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/presence.ts":{"bytes":13151,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/mesh/teleport-extension-gossip/src/index.ts":{"bytes":673,"imports":[{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip.ts","kind":"import-statement","original":"./gossip"},{"path":"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts","kind":"import-statement","original":"./gossip-extension"},{"path":"packages/core/mesh/teleport-extension-gossip/src/presence.ts","kind":"import-statement","original":"./presence"}],"format":"esm"}},"outputs":{"packages/core/mesh/teleport-extension-gossip/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23361},"packages/core/mesh/teleport-extension-gossip/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Gossip","GossipExtension","Presence"],"entryPoint":"packages/core/mesh/teleport-extension-gossip/src/index.ts","inputs":{"packages/core/mesh/teleport-extension-gossip/src/gossip.ts":{"bytesInOutput":6933},"packages/core/mesh/teleport-extension-gossip/src/gossip-extension.ts":{"bytesInOutput":2668},"packages/core/mesh/teleport-extension-gossip/src/index.ts":{"bytesInOutput":0},"packages/core/mesh/teleport-extension-gossip/src/presence.ts":{"bytesInOutput":3170}},"bytes":13121}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/teleport-extension-gossip",
|
|
3
|
-
"version": "0.3.8
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Gossip extension for teleport.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"src"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dxos/
|
|
20
|
-
"@dxos/
|
|
21
|
-
"@dxos/
|
|
22
|
-
"@dxos/
|
|
23
|
-
"@dxos/
|
|
24
|
-
"@dxos/
|
|
25
|
-
"@dxos/
|
|
26
|
-
"@dxos/node-std": "0.3.8
|
|
27
|
-
"@dxos/rpc": "0.3.8
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/util": "0.3.8
|
|
19
|
+
"@dxos/async": "0.3.8",
|
|
20
|
+
"@dxos/codec-protobuf": "0.3.8",
|
|
21
|
+
"@dxos/context": "0.3.8",
|
|
22
|
+
"@dxos/log": "0.3.8",
|
|
23
|
+
"@dxos/keys": "0.3.8",
|
|
24
|
+
"@dxos/invariant": "0.3.8",
|
|
25
|
+
"@dxos/protocols": "0.3.8",
|
|
26
|
+
"@dxos/node-std": "0.3.8",
|
|
27
|
+
"@dxos/rpc": "0.3.8",
|
|
28
|
+
"@dxos/teleport": "0.3.8",
|
|
29
|
+
"@dxos/util": "0.3.8"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"typescript": "^5.2.2"
|