Hopefully fix "Too many sync requests" after file upload 412
Addresses #1788
This commit is contained in:
parent
5c95d4e0ba
commit
804a898c98
2 changed files with 13 additions and 0 deletions
|
@ -533,6 +533,11 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = {
|
||||||
return "ERROR_412_WITHOUT_VERSION";
|
return "ERROR_412_WITHOUT_VERSION";
|
||||||
}
|
}
|
||||||
if (version > item.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({
|
return new Zotero.Sync.Storage.Result({
|
||||||
syncRequired: true
|
syncRequired: true
|
||||||
});
|
});
|
||||||
|
@ -558,6 +563,11 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = {
|
||||||
json = json[0];
|
json = json[0];
|
||||||
|
|
||||||
if (json.data.version > item.version) {
|
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({
|
return new Zotero.Sync.Storage.Result({
|
||||||
syncRequired: true
|
syncRequired: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -985,6 +985,9 @@ describe("Zotero.Sync.Storage.Mode.ZFS", function () {
|
||||||
assert.isFalse(result.localChanges);
|
assert.isFalse(result.localChanges);
|
||||||
assert.isFalse(result.remoteChanges);
|
assert.isFalse(result.remoteChanges);
|
||||||
assert.isTrue(result.syncRequired);
|
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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue