Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js, r?leplatrem draft
authorEthan Glasser-Camp <eglassercamp@mozilla.com>
Mon, 17 Oct 2016 10:20:50 -0400
changeset 426000 bad8a0206cdbceda441134e470411da39ffae8c5
parent 425967 94b0fddf96b43942bdd851a3275042909ea37e09
child 426001 7e4a1639b8a8ffb0ba4ec9f59965ca5f8e6ba676
push id32571
push usereglassercamp@mozilla.com
push dateMon, 17 Oct 2016 14:47:32 +0000
reviewersleplatrem
bugs1308515
milestone52.0a1
Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js, r?leplatrem MozReview-Commit-ID: AwLBvYQb4DX
services/common/blocklist-clients.js
--- a/services/common/blocklist-clients.js
+++ b/services/common/blocklist-clients.js
@@ -197,17 +197,18 @@ class BlocklistClient {
             // local data has been modified in some way.
             // We will attempt to fix this by retrieving the whole
             // remote collection.
             let payload = yield fetchRemoteCollection(collection);
             yield this.validateCollectionSignature(payload, collection, true);
             // if the signature is good (we haven't thrown), and the remote
             // last_modified is newer than the local last_modified, replace the
             // local data
-            if (payload.last_modified >= collection.lastModified) {
+            const localLastModified = yield collection.db.getLastModified();
+            if (payload.last_modified >= localLastModified) {
               yield collection.clear();
               yield collection.loadDump(payload.data);
             }
           } else {
             throw e;
           }
         }
         // Read local collection of records.