From 8c48b2f806838de020069dceccee9ca4ad7b3820 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 1 Dec 2016 16:01:06 -0500 Subject: [PATCH] Additional debugging for https://forums.zotero.org/discussion/63363/ --- chrome/content/zotero/xpcom/sync/syncEngine.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js index 41cef3a2e8..630ebeaa28 100644 --- 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=?`,