-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat(sync) Add a belongsTo
property in the schema
#1828
base: master
Are you sure you want to change the base?
Commits on May 15, 2024
-
feat(settings): Expose settings as a dict.
This makes it possible to use them in standalone scripts, when using `django.settings.configure(**settings_dict)`.
Configuration menu - View commit details
-
Copy full SHA for d2e3148 - Browse repository at this point
Copy the full SHA d2e3148View commit details -
Configuration menu - View commit details
-
Copy full SHA for b10b1ed - Browse repository at this point
Copy the full SHA b10b1edView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd98170 - Browse repository at this point
Copy the full SHA fd98170View commit details -
feat(WebSockets): Features a WebSocket server.
There is one "room" per map, and the server relays messages to all the other connected peers. Messages are checked for compliance with what's allowed as a security measure. They should also be checked in the clients to avoid potential attack vectors.
Configuration menu - View commit details
-
Copy full SHA for d11451a - Browse repository at this point
Copy the full SHA d11451aView commit details -
feat(websockets): First SyncEngine appearance
A new SyncEngine module has been added to the JavaScript code. It aims to sync the local changes with remote ones. This first implementation relies on a websocket connection.
Configuration menu - View commit details
-
Copy full SHA for 6122b2b - Browse repository at this point
Copy the full SHA 6122b2bView commit details -
feat(websockets): Authenticate with signed tokens.
Authentication is now done using a signed token provided by the Django server, sent by the JS client and checked by the WebSocket server. The token contains a `permissions` key that's checked to ensure the user has access to the map "room", where events will be shared by the peers.
Configuration menu - View commit details
-
Copy full SHA for 4de4907 - Browse repository at this point
Copy the full SHA 4de4907View commit details -
feat(sync): sync features and map properties
Synced objects now expose different methods, such as: - `getSyncEngine` which returns the location of the sync object. - `getMetadata` which returns the associated metadata with the object. Hooks have been added when features are created or changed, so the changes can be synced with other peers.
Configuration menu - View commit details
-
Copy full SHA for 4474f06 - Browse repository at this point
Copy the full SHA 4474f06View commit details -
feat(sync): sync map properties over websocket
All keystrokes are currently sent, which is not ideal because it will use a lot of bandwidth.
Configuration menu - View commit details
-
Copy full SHA for cd09cac - Browse repository at this point
Copy the full SHA cd09cacView commit details -
feat(sync): Sync features over websockets
Added a new `geometryToFeature` method in `umap.layer.js` which can update a given geometry if needed. A new `id` property can also be passed to the features on creation, to make it possible to have the same features `id` on different peers.
Configuration menu - View commit details
-
Copy full SHA for 8a4c50d - Browse repository at this point
Copy the full SHA 8a4c50dView commit details -
feat(sync): sync layer's properties.
This also changes the interface between the synced classes and the sync engine. The sync engines only requires two methods now: - `getSyncMetadata()` which returns all the metadata needed, including the `engine`. - `render()` which renders the object, updating the needed parts.
Configuration menu - View commit details
-
Copy full SHA for 2bd96d2 - Browse repository at this point
Copy the full SHA 2bd96d2View commit details -
feat(sync): initialize datalayers internal objects in the constructor.
Otherwise, an event can come from the websocket, trying to update an `undefined` property.
Configuration menu - View commit details
-
Copy full SHA for 1ed4784 - Browse repository at this point
Copy the full SHA 1ed4784View commit details -
feat(sync): Add a
enableSync
option.This changes how the syncEngine works. At the moment, it's always instanciated, even if no syncing is configured. It just does nothing. This is to avoid doing `if (engine) engine.update()` calls everywhere we use it. You now need to `start()` and `stop()` it.
Configuration menu - View commit details
-
Copy full SHA for c4db041 - Browse repository at this point
Copy the full SHA c4db041View commit details -
feat(sync): Add WebSocket specific settings
`WEBSOCKET_ENABLED`, `WEBSOCKET_HOST`, `WEBSOCKET_PORT` and `WEBSOCKET_URI` have been added. They are being transmitted to the client via the `map.options`. When `WEBSOCKET_ENABLED` is set to `False`, the client doesn't have the ability to be synced.
Configuration menu - View commit details
-
Copy full SHA for 33108a9 - Browse repository at this point
Copy the full SHA 33108a9View commit details -
chore(sync): Move the sync flag in the options
The goal being for it to be hidden for now. - Add a `is_owner` method on the map and use it in the view - Remove duplicated line in `global.js` - Rename `Datalayer` to `DataLayer` everywhere - Move the sync flag in the map options (next to slideshow)
Configuration menu - View commit details
-
Copy full SHA for 346391b - Browse repository at this point
Copy the full SHA 346391bView commit details -
feat(sync): Only sync when on edit mode
The is done to save server resources, for accessed maps which aren't currently being edited.
Configuration menu - View commit details
-
Copy full SHA for f964bff - Browse repository at this point
Copy the full SHA f964bffView commit details -
fix(sync): Keep features IDs for Polygons and Lines
It wasn't passed previously, so objects where duplicated.
Configuration menu - View commit details
-
Copy full SHA for 23d1c3b - Browse repository at this point
Copy the full SHA 23d1c3bView commit details -
fix(sync): Import the data when syncing GeoJSON objects.
Prior to these changes, the data wasn't transmitted over WebSocket, and even if present it wasn't taken into account.
Configuration menu - View commit details
-
Copy full SHA for 99e24d9 - Browse repository at this point
Copy the full SHA 99e24d9View commit details -
feat(sync): Sync only when the edition of a feature is over.
It's less spectacular than sending the position as it changes, but takes less bandwidth and seems good enough.
Configuration menu - View commit details
-
Copy full SHA for 5a32a3d - Browse repository at this point
Copy the full SHA 5a32a3dView commit details -
fix(sync): Allow cloning of features
Removing the `id` from the feature when cloning makes it generate a new one. Without this change, the cloned feature keep the already existing `id`, and during sync, the original object is lost (replaced by the clone). Nobody wants to be replaced by a clone.
Configuration menu - View commit details
-
Copy full SHA for 0bddba2 - Browse repository at this point
Copy the full SHA 0bddba2View commit details -
chore(schema): Add a
belongsTo
field in the schema.The goal is to use this as a security measure, to check that the updated properties belong the the "subject" when receiving sync operations.
Configuration menu - View commit details
-
Copy full SHA for 1c1dd4a - Browse repository at this point
Copy the full SHA 1c1dd4aView commit details -
chore(sync): Ensure properties can be updated before doing it.
When receiving a message, this checks the given properties belong to the "subject" before applying the message.
Configuration menu - View commit details
-
Copy full SHA for bfd7613 - Browse repository at this point
Copy the full SHA bfd7613View commit details -
fix(sync): Allow overlays to sync
`this.options.overlay` is now set during `map.initialize()`, which makes it possible to be set by incoming websocket operations.
Configuration menu - View commit details
-
Copy full SHA for 1aad901 - Browse repository at this point
Copy the full SHA 1aad901View commit details -
fix(sync): Initialize
tilelayer
andremoteData
earlier.It makes it possible to set these values on a remote peer.
Configuration menu - View commit details
-
Copy full SHA for 1d2cf98 - Browse repository at this point
Copy the full SHA 1d2cf98View commit details -
feat(sync): Avoid syncing remote datalayers' features
They will be synced on their own, and we dont want them to be present twice on the map.
Configuration menu - View commit details
-
Copy full SHA for a491a7c - Browse repository at this point
Copy the full SHA a491a7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f07826 - Browse repository at this point
Copy the full SHA 1f07826View commit details -
fix(sync): intialize the sync engine before entering edit mode.
Otherwise `this.sync` is not defined.
Configuration menu - View commit details
-
Copy full SHA for cbdcfba - Browse repository at this point
Copy the full SHA cbdcfbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81554d1 - Browse repository at this point
Copy the full SHA 81554d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 57355eb - Browse repository at this point
Copy the full SHA 57355ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61d8ccb - Browse repository at this point
Copy the full SHA 61d8ccbView commit details -
fix(sync): allow features geometries to be synced
By defining the `geometry` property in the schema.
Configuration menu - View commit details
-
Copy full SHA for 178eb2a - Browse repository at this point
Copy the full SHA 178eb2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 47070d1 - Browse repository at this point
Copy the full SHA 47070d1View commit details -
fix(sync): do not call
getSyncMetadata
if it doesn't existThis can arise when the form isn't bound to a "syncable" object. We might want to provide an utility to check an object is *syncable*, or a specific form to not attempt to sync objects which don't need it.
Configuration menu - View commit details
-
Copy full SHA for 190c353 - Browse repository at this point
Copy the full SHA 190c353View commit details -
Configuration menu - View commit details
-
Copy full SHA for 90e85f1 - Browse repository at this point
Copy the full SHA 90e85f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b85ee40 - Browse repository at this point
Copy the full SHA b85ee40View commit details -
Configuration menu - View commit details
-
Copy full SHA for 124b727 - Browse repository at this point
Copy the full SHA 124b727View commit details -
refactor(sync): Remove unnecessary complexity
Because we're relying on the `geoJSONToFeatures` method, we don't need anymore updaters, the default ones (map, datalayer, feature) are enough. It also makes the codebase compatible with our eslint configuration.
Configuration menu - View commit details
-
Copy full SHA for 991add9 - Browse repository at this point
Copy the full SHA 991add9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d95d8d4 - Browse repository at this point
Copy the full SHA d95d8d4View commit details -
feat(sync): Add JS unittests for
updateObjectValue
, and refactor.The new implementation uses `reduce`, in the hopes of producing a more readable version than old-style loops and reassignment of object values.
Configuration menu - View commit details
-
Copy full SHA for 6618f38 - Browse repository at this point
Copy the full SHA 6618f38View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0212ee - Browse repository at this point
Copy the full SHA c0212eeView commit details -
chore(tests): Rename "collaboration" tests to "optimistic merge"
As "collaboration" can be mistaken between "websocket" and "server-merge". This naming makes it explicit.
Configuration menu - View commit details
-
Copy full SHA for fff2235 - Browse repository at this point
Copy the full SHA fff2235View commit details -
tests(sync): Test that marker sync works properly
This commit handles the start and stop of the websocket server during the tests, using the xprocess library
Configuration menu - View commit details
-
Copy full SHA for 2c9b823 - Browse repository at this point
Copy the full SHA 2c9b823View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c6e0a8 - Browse repository at this point
Copy the full SHA 4c6e0a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98c3849 - Browse repository at this point
Copy the full SHA 98c3849View commit details -
Configuration menu - View commit details
-
Copy full SHA for 550a43c - Browse repository at this point
Copy the full SHA 550a43cView commit details -
test(sync): Ensure map properties are synced
This tests that the name of the map, and that zoom-control visibility is properly synced over websockets.
Configuration menu - View commit details
-
Copy full SHA for 2ca27c3 - Browse repository at this point
Copy the full SHA 2ca27c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35c51a8 - Browse repository at this point
Copy the full SHA 35c51a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea66e6a - Browse repository at this point
Copy the full SHA ea66e6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bc5af2 - Browse repository at this point
Copy the full SHA 0bc5af2View commit details -
chore(sync): use
sync=false
everywhere to stop propagationIn some cases, you want to stop the propagation of events. The previous code was using `fromSync=true` and `sync=false` interchangeably. This makes it use `sync=false` everywhere.
Configuration menu - View commit details
-
Copy full SHA for bfdc87a - Browse repository at this point
Copy the full SHA bfdc87aView commit details -
chore(sync): Sync engine now retrieves auth token
It's now it's responsability to get the authentication token from the http server and pass it to the websocket server, it will make it possible to redo the roundtrip when getting disconnected.
Configuration menu - View commit details
-
Copy full SHA for a646909 - Browse repository at this point
Copy the full SHA a646909View commit details -
chore(sync): relax some validation logic on the websocket server
Messages are now checked for conformity with the procol we defined, but stop at the `operation` boundary. Values aren't checked.
Configuration menu - View commit details
-
Copy full SHA for d897bb5 - Browse repository at this point
Copy the full SHA d897bb5View commit details
Commits on May 16, 2024
-
(but I would really like to see what web socker would look like)
Configuration menu - View commit details
-
Copy full SHA for 81b2bba - Browse repository at this point
Copy the full SHA 81b2bbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb54cbb - Browse repository at this point
Copy the full SHA cb54cbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for f115e75 - Browse repository at this point
Copy the full SHA f115e75View commit details -
chore(sync): remove
belongsTo
for nowAs it requires more discussion, it will happen in a separate pull-request.
Configuration menu - View commit details
-
Copy full SHA for 56244cf - Browse repository at this point
Copy the full SHA 56244cfView commit details -
feat(sync) Add a
belongsTo
property in the schemaThis new property allows to know what's the relation with the schema property and the different object types (map, datalayer, feature). This serves two goals: 1. Check that the incoming messages make sense (it's possible to change this property in this object) 2. Document where the property is used in practice. Because there is a lot of properties, it's hard to keep track of where they are used. This makes it explicit.
Configuration menu - View commit details
-
Copy full SHA for 82abfeb - Browse repository at this point
Copy the full SHA 82abfebView commit details