From f7572c48937eb0526c7285eee72e789fc3312a29 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 26 Dec 2024 15:28:51 +0100 Subject: [PATCH] wip(sync): do not consume own payloads django-channels broadcast even to the sender, so let's drop that payloads. --- umap/static/umap/js/modules/sync/engine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/sync/engine.js b/umap/static/umap/js/modules/sync/engine.js index 4f5a9efa..3ac14f54 100644 --- a/umap/static/umap/js/modules/sync/engine.js +++ b/umap/static/umap/js/modules/sync/engine.js @@ -124,7 +124,7 @@ export class SyncEngine { if (this.offline) return if (this.transport) { - this.transport.send('OperationMessage', message) + this.transport.send('OperationMessage', { sender: this.uuid, ...message }) } } @@ -177,6 +177,7 @@ export class SyncEngine { * @param {Object} payload */ onOperationMessage(payload) { + if (payload.sender === this.uuid) return this._operations.storeRemoteOperations([payload]) this._applyOperation(payload) }