From 72108734951e46524e54e5254309321332d54644 Mon Sep 17 00:00:00 2001 From: jlami Date: Thu, 27 Jul 2017 14:53:52 +0200 Subject: [PATCH] Ignore same revision changes Possible solution for #188 Will look for a better solution --- addon/adapters/pouch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/adapters/pouch.js b/addon/adapters/pouch.js index d40a7bf..d1128b1 100644 --- a/addon/adapters/pouch.js +++ b/addon/adapters/pouch.js @@ -80,10 +80,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; }