www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 1472781ce437b1411fad9124a93a92a73b6842d5
parent 45c944e7313aeb05a3e8c7275786e07a344067a8
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 30 Nov 2016 21:10:36 -0500

Debugging for https://forums.zotero.org/discussion/63363/

Diffstat:
Mchrome/content/zotero/xpcom/sync/syncEngine.js | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -822,7 +822,25 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi let unsyncedKeys = ids.map(id => objectsClass.getLibraryAndKeyFromID(id).key); let queueKeys = yield Zotero.Sync.Data.Local.getObjectsFromSyncQueue(objectType, this.libraryID); unsyncedKeys = Zotero.Utilities.arrayDiff(unsyncedKeys, queueKeys); - ids = unsyncedKeys.map(key => objectsClass.getIDFromLibraryAndKey(this.libraryID, key)); + // TEMP + //ids = unsyncedKeys.map(key => objectsClass.getIDFromLibraryAndKey(this.libraryID, key)); + let missing = []; + ids = unsyncedKeys.map(key => { + let id = objectsClass.getIDFromLibraryAndKey(this.libraryID, key) + if (!id) { + missing.push(key); + } + return id; + }); + if (missing.length) { + Zotero.debug("Missing " + objectTypePlural + ":"); + for (let key of missing) { + Zotero.debug(yield Zotero.DB.valueQueryAsync( + `SELECT ${objectsClass.idColumn} FROM ${objectsClass.table} WHERE libraryID=? AND key=?`, + [this.libraryID, key] + )); + } + } if (ids.length) { Zotero.debug(ids.length + " "