Skip to content

Commit ba96212

Browse files
committed
fix(sync): sync the reference-version across peers
This allows the merge algorithm to not be lost when receiving changes. Without this change, the optimistic merge algorithm isn't able to make the distinction between peers, and features end up duplicated.
1 parent 6476981 commit ba96212

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

umap/static/umap/js/umap.layer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,10 @@ U.DataLayer = L.Evented.extend({
17401740
delete data.geojson
17411741
}
17421742
this._reference_version = response.headers.get('X-Datalayer-Version')
1743+
1744+
const { engine, subject, metadata } = this.getSyncMetadata()
1745+
engine.update(subject, metadata, '_reference_version', this._reference_version)
1746+
17431747
this.setUmapId(data.id)
17441748
this.updateOptions(data)
17451749
this.backupOptions()

0 commit comments

Comments
 (0)