commit 62ef91063143b457cd79d06ab6989b12801f2002
parent 92ec1324dc4c9517d9e2ce1ba2e3e330f848a0ea
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 12 May 2016 03:02:01 -0400
Better debug output for full sync
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js
@@ -1329,9 +1329,12 @@ Zotero.Sync.Data.Engine.prototype._fullSync = Zotero.Promise.coroutine(function*
}
if (toDownload.length) {
- Zotero.debug("Downloading missing/outdated " + objectTypePlural + " in " + this.library.name);
+ Zotero.debug("Downloading missing/outdated " + objectTypePlural);
yield this._downloadObjects(objectType, toDownload);
}
+ else {
+ Zotero.debug(`No missing/outdated ${objectTypePlural} to download`);
+ }
// Mark synced objects that don't exist remotely as unsynced
let syncedKeys = yield Zotero.Sync.Data.Local.getSynced(objectType, this.libraryID);
@@ -1353,8 +1356,7 @@ Zotero.Sync.Data.Engine.prototype._fullSync = Zotero.Promise.coroutine(function*
for (let key of remoteMissing) {
let id = objectsClass.getIDFromLibraryAndKey(this.libraryID, key);
if (!id) {
- Zotero.logError(ObjectType + " " + this.libraryID + "/" + key
- + " not found to mark as unsynced");
+ Zotero.logError(`ObjectType ${key} not found to mark as unsynced`);
continue;
}
if (remoteDeleted[objectTypePlural].indexOf(key) != -1) {
@@ -1377,12 +1379,14 @@ Zotero.Sync.Data.Engine.prototype._fullSync = Zotero.Promise.coroutine(function*
// For remotely missing objects that exist locally, reset version, since old
// version will no longer match remote, and mark for upload
if (toUpload.length) {
- Zotero.debug("Marking remotely missing synced " + objectTypePlural
- + " as unsynced");
+ Zotero.debug(`Marking remotely missing synced ${objectTypePlural} as unsynced`);
yield objectsClass.updateVersion(toUpload, 0);
yield objectsClass.updateSynced(toUpload, false);
}
}
+ else {
+ Zotero.debug(`No remotely missing synced ${objectTypePlural}`);
+ }
}
break;
}