ground-db
ground-db copied to clipboard
Create conflictHandler
On the server-side there should be a conflict handler for letting the right data win.
- [ ] Create an api for building cusom conflictHandlers optional one pr. collection
- [ ] find a way of getting the diff between client and server time - this way client can calc the server time - this would be comparable with timestamps from other clients
Builtin conflictHandlers
- [x] Last write to server wins
- [ ] The newest document wins
- [ ] OT/Merging strategy
Not sure if the best pattern is server-side conflict handling - the client would prop. be a better place, allowing a conflict resolution to ask the user for advice
Hi, what are your plans on the conflict handling? Anything I could help you with?
It would be really cool to at least be able to have some basic stuff here. I want to be able to merge the data from offline clients when the come back online and keep all the the inserts changes they made
Hi @gerwinbrunner so at the moment gdb uses the Meteor "conflict handler" eg. latest change that hits the server wins.
We could perhaps outfactor the method resume stuff into a seperate package eg. "ground:methods" and the sync tab stuff into "ground:synctabs".
I'm not sure we really need method resume - could be handled in otherways eg. in the conflict handler, having it update the server if needed.
I've added some ideas at: https://github.com/GroundMeteor/db/blob/Meteor-0-9-1/groundDB.client.js#L240
You are welcome to join in - I've already rigged a qa test in https://github.com/GroundMeteor/qa for conflict handling - its failing since its not implemented - but its a start.