mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
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.
This commit is contained in:
parent
516c3d9a0d
commit
50b7188647
1 changed files with 4 additions and 0 deletions
|
@ -1740,6 +1740,10 @@ U.DataLayer = L.Evented.extend({
|
||||||
delete data.geojson
|
delete data.geojson
|
||||||
}
|
}
|
||||||
this._reference_version = response.headers.get('X-Datalayer-Version')
|
this._reference_version = response.headers.get('X-Datalayer-Version')
|
||||||
|
|
||||||
|
const { engine, subject, metadata } = this.getSyncMetadata()
|
||||||
|
engine.update(subject, metadata, '_reference_version', this._reference_version)
|
||||||
|
|
||||||
this.setUmapId(data.id)
|
this.setUmapId(data.id)
|
||||||
this.updateOptions(data)
|
this.updateOptions(data)
|
||||||
this.backupOptions()
|
this.backupOptions()
|
||||||
|
|
Loading…
Reference in a new issue