Skip to content

Commit

Permalink
Merge pull request #189 from pouchdb-community/changes-same-revision-…
Browse files Browse the repository at this point in the history
…hack

Ignore same revision changes
  • Loading branch information
jlami authored Jan 12, 2018
2 parents abf9ca1 + 7210873 commit 3d06dbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/adapters/pouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ export default DS.RESTAdapter.extend({
this.unloadedDocumentChanged(obj);
return;
}
if (!recordInStore.get('isLoaded') || recordInStore.get('hasDirtyAttributes')) {
if (!recordInStore.get('isLoaded') || recordInStore.get('rev') === change.changes[0].rev || recordInStore.get('hasDirtyAttributes')) {
// The record either hasn't loaded yet or has unpersisted local changes.
// In either case, we don't want to refresh it in the store
// (and for some substates, attempting to do so will result in an error).
// We also ignore the change if we already have the latest revision
return;
}

Expand Down

0 comments on commit 3d06dbf

Please sign in to comment.