@dxos/echo-pipeline 0.3.10-main.3645708 → 0.3.10-main.375af01
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-6XOL2DVG.mjs → chunk-W3SSYW3X.mjs} +4 -1
- package/dist/lib/browser/{chunk-6XOL2DVG.mjs.map → chunk-W3SSYW3X.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-2RIO52RK.cjs → chunk-KTFCZMAY.cjs} +7 -4
- package/dist/lib/node/{chunk-2RIO52RK.cjs.map → chunk-KTFCZMAY.cjs.map} +2 -2
- 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 +15 -15
- package/package.json +33 -33
- package/src/automerge/automerge-host.test.ts +51 -48
- package/src/automerge/automerge-host.ts +10 -0
|
@@ -205,6 +205,15 @@ class MeshNetworkAdapter extends NetworkAdapter {
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
onStartReplication: async (info) => {
|
|
208
|
+
// Note: We store only one extension per peer.
|
|
209
|
+
// There can be a case where two connected peers have more than one teleport connection between them
|
|
210
|
+
// and each of them uses different teleport connections to send messages.
|
|
211
|
+
// It works because we receive messages from all teleport connections and Automerge Repo dedup them.
|
|
212
|
+
// TODO(mykola): Use only one teleport connection per peer.
|
|
213
|
+
if (this._extensions.has(info.id)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
|
|
208
217
|
peerInfo = info;
|
|
209
218
|
// TODO(mykola): Fix race condition?
|
|
210
219
|
this._extensions.set(info.id, extension);
|
|
@@ -214,6 +223,7 @@ class MeshNetworkAdapter extends NetworkAdapter {
|
|
|
214
223
|
},
|
|
215
224
|
onSyncMessage: async ({ payload }) => {
|
|
216
225
|
const message = cbor.decode(payload) as Message;
|
|
226
|
+
// Note: automerge Repo dedup messages.
|
|
217
227
|
this.emit('message', message);
|
|
218
228
|
},
|
|
219
229
|
onClose: async () => {
|