commit 8c48b2f806838de020069dceccee9ca4ad7b3820
parent 9541a6cfcdffefcb7e4e2aa2c36504b29290db0e
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 1 Dec 2016 16:01:06 -0500
Additional debugging for https://forums.zotero.org/discussion/63363/
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js
@@ -816,10 +816,12 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi
// New/modified objects
let ids = yield Zotero.Sync.Data.Local.getUnsynced(objectType, this.libraryID);
+ let origIDs = ids; // TEMP
// Skip objects in sync queue, because they might have unresolved conflicts.
// The queue only has keys, so we have to convert to keys and back.
let unsyncedKeys = ids.map(id => objectsClass.getLibraryAndKeyFromID(id).key);
+ let origUnsynced = unsyncedKeys; // TEMP
let queueKeys = yield Zotero.Sync.Data.Local.getObjectsFromSyncQueue(objectType, this.libraryID);
unsyncedKeys = Zotero.Utilities.arrayDiff(unsyncedKeys, queueKeys);
// TEMP
@@ -828,12 +830,18 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi
ids = unsyncedKeys.map(key => {
let id = objectsClass.getIDFromLibraryAndKey(this.libraryID, key)
if (!id) {
+ Zotero.debug("Missing id for key " + key);
missing.push(key);
}
return id;
});
if (missing.length) {
Zotero.debug("Missing " + objectTypePlural + ":");
+ Zotero.debug(origIDs);
+ Zotero.debug(origUnsynced);
+ Zotero.debug(ids);
+ Zotero.debug(unsyncedKeys);
+ Zotero.debug(missing);
for (let key of missing) {
Zotero.debug(yield Zotero.DB.valueQueryAsync(
`SELECT ${objectsClass.idColumn} FROM ${objectsClass.table} WHERE libraryID=? AND key=?`,