Comments (5)
Thanks for raising the question – and sorry for the late response!
this is how it's working at the moment: your local changes get always pushed, possible conflicts remain in the couch and may be resolved, or just left. Changes coming from remote do always overwrite your local data at the moment, there is no check if your data changed locally meanwhile, we probably should add such a thing.
What would be your desired behavior / API?
from hoodie.
What would be your desired behavior / API?
Maybe have a way to specify a callback onConflict
, that is called once a conflict is detected. The developer can then implement some functionality to resolve the conflict. If the callback is not specified, the default CouchDB way of handling/merging is used.
Sorry, I still haven't looked too much into how conflict resolving works in CouchDB, so I can only give that high-level API-idea response :/
from hoodie.
We have the concept of modular background workers acting on changes in the databases.
What we could do is to implement a "conflict resolution worker". In the admin backend of your app, you could define a JavaScript function that gets called each time there is a conflict and that contains the custom logic to resolve the conflict.
Makes sense?
from hoodie.
+1
from hoodie.
I've created a new repo for a worker that will resolve conflicts in the backend:
https://github.com/hoodiehq/worker-conflict-resolver
from hoodie.
Related Issues (20)
- Hapi deprecation warnings
- npm start command fails HOT 3
- Unable to store data on CouchDB v2.2.0 HOT 3
- `options.account` and `options.store` not passed to hoodie-server
- Some question about hoodie HOT 1
- Compatible pouchdb-Browser versions HOT 10
- Keep items in local IndexedDb after signOut HOT 3
- store.findAll() return deleted items if pouchdb-browser is initialized with a low “revs_limit” and “auto_compaction: true”
- any plan for php port of the backend ? HOT 4
- Project status? HOT 8
- Good code HOT 1
- can't register hoodie plugin in hapi: Invalid register options "value" must be of type object HOT 2
- Website is down HOT 5
- Site down
- Image elements do not have [alt] attributes HOT 6
- improve UI HOT 3
- Hoodie Chat Link is broken on CONTRIBUTING.MD HOT 2
- Project Status / Maintenance HOT 6
- [Bug]: Different cursor on different buttons on landing page HOT 1
- image element do not have alt altributes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hoodie.