Bug 679279 - Part 1: minor improvements to engines code. r=philikon

In particular, tracking of _modified items no longer allows _modified to
occasionally not exist! This condition was hit in Bug 675299.
This commit is contained in:
Richard Newman 2011-08-19 17:17:58 -07:00
parent 5d45643659
commit 87ca8dd03f

View File

@ -622,9 +622,10 @@ SyncEngine.prototype = {
// Mark all items to be uploaded, but treat them as changed from long ago
this._log.debug("First sync, uploading all items");
this._modified = {};
for (let id in this._store.getAllIDs())
for (let id in this._store.getAllIDs()) {
this._modified[id] = 0;
}
}
// Clear the tracker now. If the sync fails we'll add the ones we failed
// to upload back.
this._tracker.clearChangedIDs();
@ -1079,8 +1080,8 @@ SyncEngine.prototype = {
for (let [id, when] in Iterator(this._modified)) {
this._tracker.addChangedID(id, when);
}
delete this._modified;
delete this._modifiedIDs;
this._modified = {};
this._modifiedIDs = [];
},
_sync: function SyncEngine__sync() {