Giter Site home page Giter Site logo

Comments (5)

gr2m avatar gr2m commented on August 27, 2024

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.

jviereck avatar jviereck commented on August 27, 2024

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.

gr2m avatar gr2m commented on August 27, 2024

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.

jviereck avatar jviereck commented on August 27, 2024

+1

from hoodie.

gr2m avatar gr2m commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.