diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index a982e6490c..31fefee6c7 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -533,6 +533,11 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = { return "ERROR_412_WITHOUT_VERSION"; } if (version > item.version) { + // Mark object for redownloading, in case the library version is up to date and + // it's just the attachment item that somehow didn't get updated + yield Zotero.Sync.Data.Local.addObjectsToSyncQueue( + 'item', item.libraryID, [item.key] + ); return new Zotero.Sync.Storage.Result({ syncRequired: true }); @@ -558,6 +563,11 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = { json = json[0]; if (json.data.version > item.version) { + // Mark object for redownloading, in case the library version is up to date and + // it's just the attachment item that somehow didn't get updated + yield Zotero.Sync.Data.Local.addObjectsToSyncQueue( + 'item', item.libraryID, [item.key] + ); return new Zotero.Sync.Storage.Result({ syncRequired: true }); diff --git a/test/tests/zfsTest.js b/test/tests/zfsTest.js index 41bd1d9659..f6d572868b 100644 --- a/test/tests/zfsTest.js +++ b/test/tests/zfsTest.js @@ -985,6 +985,9 @@ describe("Zotero.Sync.Storage.Mode.ZFS", function () { assert.isFalse(result.localChanges); assert.isFalse(result.remoteChanges); assert.isTrue(result.syncRequired); + // Item should be marked for redownloading + var versions = yield Zotero.Sync.Data.Local.getObjectsFromSyncQueue('item', item.libraryID); + assert.include(versions, item.key); });