Bug 1435588 - (part 2) Request records oldest first with the bookmarks buffer r=kitcambridge

This also adds a check that the sort order is valid to record.js,
since I accidentally spelt it "oldest", which didn't work at all.

MozReview-Commit-ID: 2edyyjcwGqx

--HG--
extra : rebase_source : 051378c4f79f703563a1e14a32a28956f9dcf12b
This commit is contained in:
Thom Chiovoloni 2018-02-22 18:06:45 -05:00
Родитель 8d161b9820
Коммит c82baa71a3
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -693,6 +693,10 @@ BufferedBookmarksEngine.prototype = {
// non-buffered engine is enabled.
overrideTelemetryName: "bookmarks-buffered",
// Needed to ensure we don't miss items when resuming a sync that failed or
// aborted early.
_defaultSort: "oldest",
async getLastSync() {
let mirror = await this._store.ensureOpenMirror();
return mirror.getCollectionHighWaterMark();

Просмотреть файл

@ -685,6 +685,10 @@ Collection.prototype = {
// index
get sort() { return this._sort; },
set sort(value) {
if (value && value != "oldest" && value != "newest" && value != "index") {
throw new TypeError(
`Illegal value for sort: "${value}" (should be "oldest", "newest", or "index").`);
}
this._sort = value;
this._rebuildURL();
},