Skip auto-sync on stream notification if library version is up to date

This avoids an extra no-op sync after an upload when the notification
for the change comes back down from the streaming server.
This commit is contained in:
Dan Stillman 2017-11-27 19:46:30 -05:00
parent baeb846b5c
commit 575968929c

View file

@ -219,6 +219,11 @@ Zotero.Streamer_Module.prototype = {
let skipped = Zotero.Sync.Data.Local.getSkippedLibraries();
if (skipped.includes(library.libraryID)) return;
if (data.version && data.version == library.libraryVersion) {
Zotero.debug("Library is already up to date");
return;
}
await Zotero.Sync.Runner.sync({
background: true,
libraries: [library.libraryID]