Skip to content

Add server-side syncing#187

Open
aJanuary wants to merge 1 commit intolostcarpark:mainfrom
aJanuary:add-server-sync
Open

Add server-side syncing#187
aJanuary wants to merge 1 commit intolostcarpark:mainfrom
aJanuary:add-server-sync

Conversation

@aJanuary
Copy link
Contributor

Add the ability to (optionally) sync with a server. See /docs/_server_api.md for details on the protocol.

This uses a last-write-wins approach to handling merge conflicts. This does mean that if someone does a bunch of changes in both an online and an offline instance, and then syncs the offline instance, the changes in the offline instance will win, even if chronologically they happened before the online instance. However, this is an unlikely use-case, and allows us to have a much simpler solution than something more complex like an or-set CRDT, and avoids issues with clock drift that using timestamps introduces (which present an ongoing sync issue rather than just at the point you bring one online).

Add the ability to (optionally) sync with a server. See
/docs/_server_api.md for details on the protocol.

This uses a last-write-wins approach to handling merge conflicts.
This does mean that if someone does a bunch of changes in both an online
and an offline instance, and then syncs the offline instance, the
changes in the offline instance will win, even if chronologically they
happened before the online instance. However, this is an unlikely
use-case, and allows us to have a much simpler solution than something
more complex like an or-set CRDT, and avoids issues with clock drift
that using timestamps introduces (which present an ongoing sync issue
rather than just at the point you bring one online).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what your opinion is of having an example server code in this repo.

"OFFLINE_LABEL": "Currently Offline",
"FETCH_BUTTON_LABEL": "Fetch Data Now"
},
"SYNC": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does have the downside that if you just copy config_example.json to config.json, it will now error if you're not running a server. An option would be to not include this in the example config.

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.

1 participant