Additional debugging for https://forums.zotero.org/discussion/63363/
This commit is contained in:
parent
9541a6cfcd
commit
8c48b2f806
1 changed files with 8 additions and 0 deletions
|
@ -816,10 +816,12 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi
|
||||||
|
|
||||||
// New/modified objects
|
// New/modified objects
|
||||||
let ids = yield Zotero.Sync.Data.Local.getUnsynced(objectType, this.libraryID);
|
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.
|
// 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.
|
// The queue only has keys, so we have to convert to keys and back.
|
||||||
let unsyncedKeys = ids.map(id => objectsClass.getLibraryAndKeyFromID(id).key);
|
let unsyncedKeys = ids.map(id => objectsClass.getLibraryAndKeyFromID(id).key);
|
||||||
|
let origUnsynced = unsyncedKeys; // TEMP
|
||||||
let queueKeys = yield Zotero.Sync.Data.Local.getObjectsFromSyncQueue(objectType, this.libraryID);
|
let queueKeys = yield Zotero.Sync.Data.Local.getObjectsFromSyncQueue(objectType, this.libraryID);
|
||||||
unsyncedKeys = Zotero.Utilities.arrayDiff(unsyncedKeys, queueKeys);
|
unsyncedKeys = Zotero.Utilities.arrayDiff(unsyncedKeys, queueKeys);
|
||||||
// TEMP
|
// TEMP
|
||||||
|
@ -828,12 +830,18 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi
|
||||||
ids = unsyncedKeys.map(key => {
|
ids = unsyncedKeys.map(key => {
|
||||||
let id = objectsClass.getIDFromLibraryAndKey(this.libraryID, key)
|
let id = objectsClass.getIDFromLibraryAndKey(this.libraryID, key)
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
Zotero.debug("Missing id for key " + key);
|
||||||
missing.push(key);
|
missing.push(key);
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
});
|
});
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
Zotero.debug("Missing " + objectTypePlural + ":");
|
Zotero.debug("Missing " + objectTypePlural + ":");
|
||||||
|
Zotero.debug(origIDs);
|
||||||
|
Zotero.debug(origUnsynced);
|
||||||
|
Zotero.debug(ids);
|
||||||
|
Zotero.debug(unsyncedKeys);
|
||||||
|
Zotero.debug(missing);
|
||||||
for (let key of missing) {
|
for (let key of missing) {
|
||||||
Zotero.debug(yield Zotero.DB.valueQueryAsync(
|
Zotero.debug(yield Zotero.DB.valueQueryAsync(
|
||||||
`SELECT ${objectsClass.idColumn} FROM ${objectsClass.table} WHERE libraryID=? AND key=?`,
|
`SELECT ${objectsClass.idColumn} FROM ${objectsClass.table} WHERE libraryID=? AND key=?`,
|
||||||
|
|
Loading…
Reference in a new issue