Additional debugging for group sync issue

https://forums.zotero.org/discussion/68299/group-library-not-showing-up-report-id-198634382
This commit is contained in:
Dan Stillman 2017-10-25 23:51:25 -04:00
parent 73d88421bb
commit d08db42f7b

View File

@ -371,8 +371,10 @@ Zotero.Sync.Runner_Module = function (options = {}) {
}
let remoteGroupVersions = yield client.getGroupVersions(keyInfo.userID);
Zotero.debug(remoteGroupVersions);
let remoteGroupIDs = Object.keys(remoteGroupVersions).map(id => parseInt(id));
let skippedGroups = Zotero.Sync.Data.Local.getSkippedGroups();
Zotero.debug(skippedGroups);
// Remove skipped groups
if (syncAllLibraries) {
@ -390,10 +392,12 @@ Zotero.Sync.Runner_Module = function (options = {}) {
// If syncing all libraries, mark any that don't exist, are outdated, or are
// archived locally for update. Group is added to the library list after downloading.
if (!group || group.version < remoteGroupVersions[id] || group.archived) {
Zotero.debug(`Marking group ${id} to download`);
groupsToDownload.push(id);
}
// If not outdated, just add to library list
else {
Zotero.debug(`Adding group library ${group.libraryID} to sync`);
libraries.push(group.libraryID);
}
}
@ -425,6 +429,8 @@ Zotero.Sync.Runner_Module = function (options = {}) {
.filter(id => Zotero.Libraries.get(id).libraryType == 'group')
.map(id => Zotero.Groups.getGroupIDFromLibraryID(id))
}
Zotero.debug("Local groups:");
Zotero.debug(localGroups);
remotelyMissingGroups = Zotero.Utilities.arrayDiff(localGroups, remoteGroupIDs)
.map(id => Zotero.Groups.get(id));
}
@ -547,6 +553,8 @@ Zotero.Sync.Runner_Module = function (options = {}) {
}
// Note: If any non-group library types become archivable, they'll need to be unarchived here.
Zotero.debug("Final libraries to sync:");
Zotero.debug(libraries);
return [...new Set(libraries)];
});