Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make the client create the DataLayer.id #2259

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

yohanboniface
Copy link
Member

Rebase of #2233

@yohanboniface yohanboniface force-pushed the layers-uuid2 branch 4 times, most recently from d003de6 to 606d3b9 Compare November 15, 2024 14:12
This make it possible to synchronize datalayers before their creation on
the server, allowing at the same time to solve issues related to them
not being saved (e.g. duplication of geometries)

We use the DataLayer._referenceVersion to track if a DataLayer has been
saved on the server.

After a save, the _referenceVersion is synched with other peers.

To pass the reference version from the server to the frontend, we have two
options:
- use a header
- populate the `options.version` field

In the case of a GET on a Datalayer, we could not use the `options` scenario
because:
- the value in the file is not up to date (it was the value the client has
 before the save)
- the python cannot change it on the fly, as the file is served by nginx

So we decided to keep using a header. But on the map view, we load all
datalayers metadatas in the map options, so here we cannot use the header
scenario, so in this specific case we had to populate `options._referenceVersion`.

At the same time, we also changed:
- Umap.options.umap_id => Umap.id
- DataLayer.umap_id => Datalayer.id
- fixed the version number returned by DataLayer.version_metadata
@yohanboniface yohanboniface merged commit 8105376 into master Nov 15, 2024
4 checks passed
@yohanboniface yohanboniface deleted the layers-uuid2 branch November 15, 2024 14:36
@yohanboniface yohanboniface changed the title Layers uuid2 chore: make the client create the DataLayer.id Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants