Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js, r?leplatrem
MozReview-Commit-ID: AwLBvYQb4DX
--- 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.