--- a/services/sync/modules/engines/history.js
+++ b/services/sync/modules/engines/history.js
@@ -61,22 +61,22 @@ HistoryEngine.prototype = {
displayName: "History",
logName: "History",
_storeObj: HistoryStore,
_trackerObj: HistoryTracker,
// History reconciliation is simpler than the default one from SyncEngine,
// because we have the advantage that we can use the URI as a definitive
// check for local existence of incoming items. The steps are as follows:
- //
+ //
// 1) Check for the same item in the locally modified list. In that case,
// local trumps remote. This step is unchanged from our superclass.
// 2) Check if the incoming item was deleted. Skip if so.
// 3) Apply new record/update.
- //
+ //
// Note that we don't attempt to equalize the IDs, the history store does that
// as part of update()
_reconcile: function HistEngine__reconcile(item) {
let self = yield;
let ret = true;
// Step 1: Check for conflicts
// If same as local record, do not upload
@@ -393,17 +393,17 @@ HistoryStore.prototype = {
if (curvisits.filter(function(i) i.date == visit.date).length)
continue;
this._log.debug(" visit " + visit.date);
this._hsvc.addVisit(uri, visit.date, null, visit.type,
(visit.type == 5 || visit.type == 6), 0);
}
this._hsvc.setPageTitle(uri, record.cleartext.title);
- // Equalize IDs
+ // Equalize IDs
let localId = this._getGUID(record.cleartext.uri);
if (localId != record.id)
this.changeItemID(localId, record.id);
},
itemExists: function HistStore_itemExists(id) {
if (this._findURLByGUID(id))
@@ -415,16 +415,17 @@ HistoryStore.prototype = {
if (typeof(url) == "string")
url = Utils.makeURI(url);
return this._hsvc.isVisited(url);
},
createRecord: function HistStore_createRecord(guid) {
let foo = this._findURLByGUID(guid);
let record = new HistoryRec();
+ record.id = guid;
if (foo) {
record.histUri = foo.url;
record.title = foo.title;
record.visits = this._getVisits(record.histUri);
} else {
record.cleartext = null; // deleted item
}
this.cache.put(guid, record);