@dxos/echo-pipeline 0.3.11-next.0fb359e → 0.3.11-next.e28df4f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-W3SSYW3X.mjs → chunk-D7UMNYLJ.mjs} +272 -85
- package/dist/lib/browser/chunk-D7UMNYLJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +33 -11
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node/{chunk-KTFCZMAY.cjs → chunk-GQW6RLGD.cjs} +267 -83
- package/dist/lib/node/chunk-GQW6RLGD.cjs.map +7 -0
- package/dist/lib/node/index.cjs +26 -26
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +46 -25
- package/dist/lib/node/testing/index.cjs.map +4 -4
- package/dist/types/src/automerge/automerge-host.d.ts +37 -2
- package/dist/types/src/automerge/automerge-host.d.ts.map +1 -1
- package/dist/types/src/automerge/index.d.ts +1 -1
- package/dist/types/src/automerge/index.d.ts.map +1 -1
- package/dist/types/src/metadata/metadata-store.d.ts +1 -3
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
- package/dist/types/src/space/space-manager.d.ts +2 -2
- package/dist/types/src/space/space-manager.d.ts.map +1 -1
- package/dist/types/src/space/space-protocol.d.ts.map +1 -1
- package/dist/types/src/space/space.d.ts +1 -1
- package/dist/types/src/space/space.d.ts.map +1 -1
- package/dist/types/src/testing/change-metadata.d.ts +8 -0
- package/dist/types/src/testing/change-metadata.d.ts.map +1 -0
- package/dist/types/src/testing/database-test-rig.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/automerge/automerge-host.test.ts +319 -34
- package/src/automerge/automerge-host.ts +137 -20
- package/src/automerge/index.ts +1 -1
- package/src/metadata/metadata-store.ts +12 -2
- package/src/pipeline/pipeline-stress.test.ts +9 -2
- package/src/space/data-pipeline.ts +4 -3
- package/src/space/space-manager.ts +3 -3
- package/src/space/space-protocol.ts +4 -0
- package/src/space/space.ts +8 -3
- package/src/testing/change-metadata.ts +27 -0
- package/src/testing/database-test-rig.ts +4 -1
- package/src/testing/index.ts +1 -0
- package/src/testing/test-agent-builder.ts +1 -1
- package/dist/lib/browser/chunk-W3SSYW3X.mjs.map +0 -7
- package/dist/lib/node/chunk-KTFCZMAY.cjs.map +0 -7
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { randomBytes } from 'crypto';
|
|
5
6
|
import expect from 'expect';
|
|
7
|
+
import waitForExpect from 'wait-for-expect';
|
|
6
8
|
|
|
7
9
|
import { Trigger, asyncTimeout, sleep } from '@dxos/async';
|
|
8
10
|
import { type Message, NetworkAdapter, type PeerId, Repo } from '@dxos/automerge/automerge-repo';
|
|
9
11
|
import { invariant } from '@dxos/invariant';
|
|
10
12
|
import { log } from '@dxos/log';
|
|
11
13
|
import { StorageType, createStorage } from '@dxos/random-access-storage';
|
|
12
|
-
import {
|
|
14
|
+
import { TestBuilder as TeleportBuilder, TestPeer as TeleportPeer } from '@dxos/teleport/testing';
|
|
15
|
+
import { afterTest, describe, test } from '@dxos/test';
|
|
16
|
+
import { arrayToBuffer, bufferToArray } from '@dxos/util';
|
|
13
17
|
|
|
14
|
-
import { AutomergeHost } from './automerge-host';
|
|
18
|
+
import { AutomergeHost, AutomergeStorageAdapter, MeshNetworkAdapter } from './automerge-host';
|
|
15
19
|
|
|
16
20
|
describe('AutomergeHost', () => {
|
|
17
21
|
test('can create documents', () => {
|
|
@@ -44,13 +48,12 @@ describe('AutomergeHost', () => {
|
|
|
44
48
|
});
|
|
45
49
|
|
|
46
50
|
test('basic networking', async () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const clientAdapter = new TestAdapter(context, 'client');
|
|
51
|
+
const hostAdapter: TestAdapter = new TestAdapter({
|
|
52
|
+
send: (message: Message) => clientAdapter.receive(message),
|
|
53
|
+
});
|
|
54
|
+
const clientAdapter: TestAdapter = new TestAdapter({
|
|
55
|
+
send: (message: Message) => hostAdapter.receive(message),
|
|
56
|
+
});
|
|
54
57
|
|
|
55
58
|
const host = new Repo({
|
|
56
59
|
network: [hostAdapter],
|
|
@@ -60,6 +63,10 @@ describe('AutomergeHost', () => {
|
|
|
60
63
|
});
|
|
61
64
|
hostAdapter.ready();
|
|
62
65
|
clientAdapter.ready();
|
|
66
|
+
await hostAdapter.onConnect.wait();
|
|
67
|
+
await clientAdapter.onConnect.wait();
|
|
68
|
+
hostAdapter.peerCandidate(clientAdapter.peerId!);
|
|
69
|
+
clientAdapter.peerCandidate(hostAdapter.peerId!);
|
|
63
70
|
|
|
64
71
|
const handle = host.create();
|
|
65
72
|
const text = 'Hello world';
|
|
@@ -68,17 +75,301 @@ describe('AutomergeHost', () => {
|
|
|
68
75
|
});
|
|
69
76
|
|
|
70
77
|
const docOnClient = client.find(handle.url);
|
|
71
|
-
await asyncTimeout(docOnClient.
|
|
72
|
-
expect(docOnClient.docSync().text).toEqual(text);
|
|
78
|
+
expect((await asyncTimeout(docOnClient.doc(), 1000)).text).toEqual(text);
|
|
73
79
|
});
|
|
74
80
|
|
|
75
|
-
test('
|
|
76
|
-
|
|
81
|
+
test('recovering from a lost connection', async () => {
|
|
82
|
+
let connectionState: 'on' | 'off' = 'on';
|
|
83
|
+
|
|
84
|
+
const hostAdapter: TestAdapter = new TestAdapter({
|
|
85
|
+
send: (message: Message) => connectionState === 'on' && sleep(10).then(() => clientAdapter.receive(message)),
|
|
86
|
+
});
|
|
87
|
+
const clientAdapter: TestAdapter = new TestAdapter({
|
|
88
|
+
send: (message: Message) => connectionState === 'on' && sleep(10).then(() => hostAdapter.receive(message)),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const host = new Repo({
|
|
92
|
+
network: [hostAdapter],
|
|
93
|
+
});
|
|
94
|
+
const client = new Repo({
|
|
95
|
+
network: [clientAdapter],
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Establish connection.
|
|
99
|
+
hostAdapter.ready();
|
|
100
|
+
clientAdapter.ready();
|
|
101
|
+
await hostAdapter.onConnect.wait();
|
|
102
|
+
await clientAdapter.onConnect.wait();
|
|
103
|
+
hostAdapter.peerCandidate(clientAdapter.peerId!);
|
|
104
|
+
clientAdapter.peerCandidate(hostAdapter.peerId!);
|
|
105
|
+
|
|
106
|
+
const handle = host.create();
|
|
107
|
+
const docOnClient = client.find(handle.url);
|
|
108
|
+
{
|
|
109
|
+
const sanityText = 'Hello world';
|
|
110
|
+
handle.change((doc: any) => {
|
|
111
|
+
doc.sanityText = sanityText;
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
expect((await asyncTimeout(docOnClient.doc(), 1000)).sanityText).toEqual(sanityText);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Disrupt connection.
|
|
118
|
+
const offlineText = 'This has been written while the connection was off';
|
|
119
|
+
{
|
|
120
|
+
connectionState = 'off';
|
|
121
|
+
|
|
122
|
+
handle.change((doc: any) => {
|
|
123
|
+
doc.offlineText = offlineText;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
await sleep(100);
|
|
127
|
+
expect((await asyncTimeout(docOnClient.doc(), 1000)).offlineText).toBeUndefined();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Re-establish connection.
|
|
131
|
+
const onlineText = 'This has been written after the connection was re-established';
|
|
132
|
+
{
|
|
133
|
+
connectionState = 'on';
|
|
134
|
+
hostAdapter.peerDisconnected(clientAdapter.peerId!);
|
|
135
|
+
clientAdapter.peerDisconnected(hostAdapter.peerId!);
|
|
136
|
+
hostAdapter.peerCandidate(clientAdapter.peerId!);
|
|
137
|
+
clientAdapter.peerCandidate(hostAdapter.peerId!);
|
|
138
|
+
|
|
139
|
+
handle.change((doc: any) => {
|
|
140
|
+
doc.onlineText = onlineText;
|
|
141
|
+
});
|
|
142
|
+
await sleep(100);
|
|
143
|
+
expect((await asyncTimeout(docOnClient.doc(), 1000)).onlineText).toEqual(onlineText);
|
|
144
|
+
expect((await asyncTimeout(docOnClient.doc(), 1000)).offlineText).toEqual(offlineText);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('integration test with teleport', async () => {
|
|
149
|
+
const createAutomergeRepo = () => {
|
|
150
|
+
const meshAdapter = new MeshNetworkAdapter();
|
|
151
|
+
const repo = new Repo({
|
|
152
|
+
network: [meshAdapter],
|
|
153
|
+
});
|
|
154
|
+
meshAdapter.ready();
|
|
155
|
+
return { repo, meshAdapter };
|
|
156
|
+
};
|
|
157
|
+
const peer1 = createAutomergeRepo();
|
|
158
|
+
const peer2 = createAutomergeRepo();
|
|
159
|
+
const handle = peer1.repo.create();
|
|
160
|
+
|
|
161
|
+
const teleportBuilder = new TeleportBuilder();
|
|
162
|
+
afterTest(() => teleportBuilder.destroy());
|
|
163
|
+
|
|
164
|
+
const [teleportPeer1, teleportPeer2] = teleportBuilder.createPeers({ factory: () => new TeleportPeer() });
|
|
165
|
+
{
|
|
166
|
+
// Initiate connection.
|
|
167
|
+
const [connection1, connection2] = await teleportBuilder.connect(teleportPeer1, teleportPeer2);
|
|
168
|
+
connection1.teleport.addExtension('automerge', peer1.meshAdapter.createExtension());
|
|
169
|
+
connection2.teleport.addExtension('automerge', peer2.meshAdapter.createExtension());
|
|
170
|
+
|
|
171
|
+
// Test connection.
|
|
172
|
+
const text = 'Hello world';
|
|
173
|
+
handle.change((doc: any) => {
|
|
174
|
+
doc.text = text;
|
|
175
|
+
});
|
|
176
|
+
const docOnPeer2 = peer2.repo.find(handle.url);
|
|
177
|
+
await waitForExpect(async () => expect((await asyncTimeout(docOnPeer2.doc(), 1000)).text).toEqual(text), 1000);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const offlineText = 'This has been written while the connection was off';
|
|
181
|
+
{
|
|
182
|
+
// Disconnect peers.
|
|
183
|
+
await teleportBuilder.disconnect(teleportPeer1, teleportPeer2);
|
|
184
|
+
|
|
185
|
+
// Make offline changes.
|
|
186
|
+
const offlineText = 'This has been written while the connection was off';
|
|
187
|
+
handle.change((doc: any) => {
|
|
188
|
+
doc.offlineText = offlineText;
|
|
189
|
+
});
|
|
190
|
+
const docOnPeer2 = peer2.repo.find(handle.url);
|
|
191
|
+
await sleep(100);
|
|
192
|
+
expect((await asyncTimeout(docOnPeer2.doc(), 1000)).offlineText).toBeUndefined();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
{
|
|
196
|
+
// Reconnect peers.
|
|
197
|
+
const [connection1, connection2] = await teleportBuilder.connect(teleportPeer1, teleportPeer2);
|
|
198
|
+
connection1.teleport.addExtension('automerge', peer1.meshAdapter.createExtension());
|
|
199
|
+
connection2.teleport.addExtension('automerge', peer2.meshAdapter.createExtension());
|
|
200
|
+
|
|
201
|
+
// Wait for offline changes to be synced.
|
|
202
|
+
const docOnPeer2 = peer2.repo.find(handle.url);
|
|
203
|
+
await waitForExpect(
|
|
204
|
+
async () => expect((await asyncTimeout(docOnPeer2.doc(), 1000)).offlineText).toEqual(offlineText),
|
|
205
|
+
1000,
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
// Test connection.
|
|
209
|
+
const onlineText = 'This has been written after the connection was re-established';
|
|
210
|
+
handle.change((doc: any) => {
|
|
211
|
+
doc.onlineText = onlineText;
|
|
212
|
+
});
|
|
213
|
+
await waitForExpect(
|
|
214
|
+
async () => expect((await asyncTimeout(docOnPeer2.doc(), 1000)).onlineText).toEqual(onlineText),
|
|
215
|
+
1000,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
describe('storage', () => {
|
|
221
|
+
test('load range on node', async () => {
|
|
222
|
+
const root = `/tmp/${randomBytes(16).toString('hex')}`;
|
|
223
|
+
{
|
|
224
|
+
const storage = createStorage({ type: StorageType.NODE, root });
|
|
225
|
+
const adapter = new AutomergeStorageAdapter(storage.createDirectory());
|
|
77
226
|
|
|
78
|
-
|
|
227
|
+
await adapter.save(['test', '1'], bufferToArray(Buffer.from('one')));
|
|
228
|
+
await adapter.save(['test', '2'], bufferToArray(Buffer.from('two')));
|
|
229
|
+
await adapter.save(['bar', '1'], bufferToArray(Buffer.from('bar')));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
{
|
|
233
|
+
const storage = createStorage({ type: StorageType.NODE, root });
|
|
234
|
+
const adapter = new AutomergeStorageAdapter(storage.createDirectory());
|
|
235
|
+
|
|
236
|
+
const range = await adapter.loadRange(['test']);
|
|
237
|
+
expect(range.map((chunk) => arrayToBuffer(chunk.data!).toString())).toEqual(['one', 'two']);
|
|
238
|
+
expect(range.map((chunk) => chunk.key)).toEqual([
|
|
239
|
+
['test', '1'],
|
|
240
|
+
['test', '2'],
|
|
241
|
+
]);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test('removeRange on node', async () => {
|
|
246
|
+
const root = `/tmp/${randomBytes(16).toString('hex')}`;
|
|
247
|
+
{
|
|
248
|
+
const storage = createStorage({ type: StorageType.NODE, root });
|
|
249
|
+
const adapter = new AutomergeStorageAdapter(storage.createDirectory());
|
|
250
|
+
await adapter.save(['test', '1'], bufferToArray(Buffer.from('one')));
|
|
251
|
+
await adapter.save(['test', '2'], bufferToArray(Buffer.from('two')));
|
|
252
|
+
await adapter.save(['bar', '1'], bufferToArray(Buffer.from('bar')));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
{
|
|
256
|
+
const storage = createStorage({ type: StorageType.NODE, root });
|
|
257
|
+
const adapter = new AutomergeStorageAdapter(storage.createDirectory());
|
|
258
|
+
await adapter.removeRange(['test']);
|
|
259
|
+
const range = await adapter.loadRange(['test']);
|
|
260
|
+
expect(range.map((chunk) => arrayToBuffer(chunk.data!).toString())).toEqual([]);
|
|
261
|
+
const range2 = await adapter.loadRange(['bar']);
|
|
262
|
+
expect(range2.map((chunk) => arrayToBuffer(chunk.data!).toString())).toEqual(['bar']);
|
|
263
|
+
expect(range2.map((chunk) => chunk.key)).toEqual([['bar', '1']]);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
test('replication though a 4 peer chain', async () => {
|
|
269
|
+
const pairAB = TestAdapter.createPair();
|
|
270
|
+
const pairBC = TestAdapter.createPair();
|
|
271
|
+
const pairCD = TestAdapter.createPair();
|
|
272
|
+
|
|
273
|
+
const repoA = new Repo({
|
|
274
|
+
peerId: 'A' as any,
|
|
275
|
+
network: [pairAB[0]],
|
|
276
|
+
sharePolicy: async () => true,
|
|
277
|
+
});
|
|
278
|
+
const _repoB = new Repo({
|
|
279
|
+
peerId: 'B' as any,
|
|
280
|
+
network: [pairAB[1], pairBC[0]],
|
|
281
|
+
sharePolicy: async () => true,
|
|
282
|
+
});
|
|
283
|
+
const _repoC = new Repo({
|
|
284
|
+
peerId: 'C' as any,
|
|
285
|
+
network: [pairBC[1], pairCD[0]],
|
|
286
|
+
sharePolicy: async () => true,
|
|
287
|
+
});
|
|
288
|
+
const repoD = new Repo({
|
|
289
|
+
peerId: 'D' as any,
|
|
290
|
+
network: [pairCD[1]],
|
|
291
|
+
sharePolicy: async () => true,
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
for (const pair of [pairAB, pairBC, pairCD]) {
|
|
295
|
+
pair[0].ready();
|
|
296
|
+
pair[1].ready();
|
|
297
|
+
await pair[0].onConnect.wait();
|
|
298
|
+
await pair[1].onConnect.wait();
|
|
299
|
+
pair[0].peerCandidate(pair[1].peerId!);
|
|
300
|
+
pair[1].peerCandidate(pair[0].peerId!);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const docA = repoA.create();
|
|
304
|
+
// NOTE: Doesn't work if the doc is empty.
|
|
305
|
+
docA.change((doc: any) => {
|
|
306
|
+
doc.text = 'Hello world';
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// If we wait here for replication to finish naturally, the test will pass.
|
|
310
|
+
|
|
311
|
+
const docD = repoD.find(docA.url);
|
|
312
|
+
|
|
313
|
+
await docD.whenReady();
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test('replication though a 3 peer chain', async () => {
|
|
317
|
+
const pairAB = TestAdapter.createPair();
|
|
318
|
+
const pairBC = TestAdapter.createPair();
|
|
319
|
+
|
|
320
|
+
const repoA = new Repo({
|
|
321
|
+
peerId: 'A' as any,
|
|
322
|
+
network: [pairAB[0]],
|
|
323
|
+
sharePolicy: async () => true,
|
|
324
|
+
});
|
|
325
|
+
const repoB = new Repo({
|
|
326
|
+
peerId: 'B' as any,
|
|
327
|
+
network: [pairAB[1], pairBC[0]],
|
|
328
|
+
sharePolicy: async () => true,
|
|
329
|
+
});
|
|
330
|
+
const repoC = new Repo({
|
|
331
|
+
peerId: 'C' as any,
|
|
332
|
+
network: [pairBC[1]],
|
|
333
|
+
sharePolicy: async () => true,
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
for (const pair of [pairAB, pairBC]) {
|
|
337
|
+
pair[0].ready();
|
|
338
|
+
pair[1].ready();
|
|
339
|
+
await pair[0].onConnect.wait();
|
|
340
|
+
await pair[1].onConnect.wait();
|
|
341
|
+
pair[0].peerCandidate(pair[1].peerId!);
|
|
342
|
+
pair[1].peerCandidate(pair[0].peerId!);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const docA = repoA.create();
|
|
346
|
+
// NOTE: Doesn't work if the doc is empty.
|
|
347
|
+
docA.change((doc: any) => {
|
|
348
|
+
doc.text = 'Hello world';
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const _docB = repoB.find(docA.url);
|
|
352
|
+
const docC = repoC.find(docA.url);
|
|
353
|
+
|
|
354
|
+
await docC.whenReady();
|
|
355
|
+
});
|
|
356
|
+
});
|
|
79
357
|
|
|
80
358
|
class TestAdapter extends NetworkAdapter {
|
|
81
|
-
|
|
359
|
+
static createPair() {
|
|
360
|
+
const adapter1: TestAdapter = new TestAdapter({
|
|
361
|
+
send: (message: Message) => sleep(10).then(() => adapter2.receive(message)),
|
|
362
|
+
});
|
|
363
|
+
const adapter2: TestAdapter = new TestAdapter({
|
|
364
|
+
send: (message: Message) => sleep(10).then(() => adapter1.receive(message)),
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
return [adapter1, adapter2];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
public onConnect = new Trigger();
|
|
371
|
+
|
|
372
|
+
constructor(private readonly _params: { send: (message: Message) => void }) {
|
|
82
373
|
super();
|
|
83
374
|
}
|
|
84
375
|
|
|
@@ -90,32 +381,26 @@ class TestAdapter extends NetworkAdapter {
|
|
|
90
381
|
|
|
91
382
|
override connect(peerId: PeerId) {
|
|
92
383
|
this.peerId = peerId;
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
384
|
+
this.onConnect.wake();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
peerCandidate(peerId: PeerId) {
|
|
388
|
+
invariant(peerId, 'PeerId is required');
|
|
389
|
+
this.emit('peer-candidate', { peerId, peerMetadata: {} });
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
peerDisconnected(peerId: PeerId) {
|
|
393
|
+
invariant(peerId, 'PeerId is required');
|
|
394
|
+
this.emit('peer-disconnected', { peerId });
|
|
103
395
|
}
|
|
104
396
|
|
|
105
397
|
override send(message: Message) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.then((adapter) => {
|
|
109
|
-
adapter.receive(message);
|
|
110
|
-
})
|
|
111
|
-
.catch((error) => {
|
|
112
|
-
log.catch(error);
|
|
113
|
-
});
|
|
398
|
+
log('send', { from: message.senderId, to: message.targetId, type: message.type });
|
|
399
|
+
this._params.send(message);
|
|
114
400
|
}
|
|
115
401
|
|
|
116
402
|
override disconnect() {
|
|
117
403
|
this.peerId = undefined;
|
|
118
|
-
this.context[this.role].reset();
|
|
119
404
|
}
|
|
120
405
|
|
|
121
406
|
receive(message: Message) {
|