You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conflicts can be automatically merged with app-specific logic
Show custom UI to have the user handle conflicts manually
Dream API
I'll keep that updated based on the discussion in this issue.
// all objects returned by all hoodie.store methods and passed// to all events (change, add, update, remove) have a _conflicts property.// To find all objects having a conflict, use hoodie.store.findAll with a filter functionhoodie.store.findAll(function(object){returnobject._conflicts!==undefined;}).then(function(objectsWithConflicts){objectsWithConflicts.forEach(function(object){object._conflicts// array of conflicting versions})})// To resolve a conflict, the hoodie.store update methods accept a `removeConflicts` option.hoodie.store.update(winningObjectVersion,{removeConflicts: true}).then(function(newObjectVersion){newObjectVersion._conflicts// undefined});// It can also be an array of the conflicting rev IDs or entire objecthoodie.store.update(object,{removeConflicts: [losingVersion1,losingVersion2]})// Removing an object always automatically removes all conflicting revisionshoodie.store.remove(object)// You can listen to conflicts happening in the backgroundhoodie.store.on('change',function(object){if(object._conflicts){// update UI and/or handle conflict}})
The text was updated successfully, but these errors were encountered:
follow up for https://github.com/hoodiehq/wip-hoodie-store-on-pouchdb/issues/32 (make sure to check the discussion, lots of great thoughts in there!)
I see two ways to handle conflicts:
Dream API
I'll keep that updated based on the discussion in this issue.
The text was updated successfully, but these errors were encountered: