-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleted conflicts do not propagate between nodes #113
Comments
It is indeed intended that deletions propagate throughout the network. AFAIK, shouldn't ember-pouch update the Ember store when it receives changes from a remote database that delete a record? If not, it does indeed sound like a bug. I.e. these lines of code are supposed to do what you're asking, assuming that it actually works as intended. |
I do not quite understand what happens. When I create such a conflict where 2 Clients change the doc parallel/offline and click on delete on any client, for that client it disappears while the other client will get the "old" value (the loser of the conflict). When I reload the route/site for the client which "deleted" the doc, the doc will be there again with the "old" value. |
It sounds to me like what's happening here is that deleted conflicts are not being properly propagated from PouchDB to Ember Data. In fact, the behavior you describe is something baked into PouchDB replication, and it works trivially if you use vanilla PouchDB. So that strongly suggests to me that it's the PouchDB -> Ember Data conversion layer that's at fault here. |
So we have to look at the adapter file? Maybe you can give a hint on what I have to look at? |
I would recommend using something like the PouchDB Inspector extension or the IndexedDB view in the Chrome Dev Tools and then comparing it against what you see in your UI. If there's a difference, then the PouchDB -> EmberData mapping is messed up. And yes, that logic can be found here. |
TL;DR: How do I tell ember-pouch to delete the entire doc (not just the rev) with model.destroyRecord?
I have a simple setup with a list of friends with names. I create a new friend
Mike
on Client A. It gets synced to Client B. Now I change the name of the friend toPeter
on Client B while being offline and parallel I change the name toArnold
on Client A while being online. When Client B gets online again, we have a conflict, it makes sense. A winner will be selected, so far so good.Now I want to delete this friend. But what happens? The friend does not disappear. The friend will get the name of the "loser" leaf instead. I read that this is intended.
But how do I tell ember/ember-pouch/pouch to delete the entire doc when I click destroyRecord within ember?
The text was updated successfully, but these errors were encountered: