Fix hang in sync tests from library version changes
This commit is contained in:
parent
0965079842
commit
2df630e83c
|
@ -48,6 +48,8 @@ Zotero.Sync.Data.Engine = function (options) {
|
||||||
|
|
||||||
this.apiClient = options.apiClient;
|
this.apiClient = options.apiClient;
|
||||||
this.libraryID = options.libraryID;
|
this.libraryID = options.libraryID;
|
||||||
|
this.library = Zotero.Libraries.get(options.libraryID);
|
||||||
|
// TODO: Remove
|
||||||
this.libraryName = Zotero.Libraries.getName(options.libraryID);
|
this.libraryName = Zotero.Libraries.getName(options.libraryID);
|
||||||
this.libraryType = Zotero.Libraries.getType(options.libraryID);
|
this.libraryType = Zotero.Libraries.getType(options.libraryID);
|
||||||
switch (this.libraryType) {
|
switch (this.libraryType) {
|
||||||
|
@ -691,7 +693,8 @@ Zotero.Sync.Data.Engine.prototype._startUpload = Zotero.Promise.coroutine(functi
|
||||||
for (let i = 0; i < toSave.length; i++) {
|
for (let i = 0; i < toSave.length; i++) {
|
||||||
yield toSave[i].save();
|
yield toSave[i].save();
|
||||||
}
|
}
|
||||||
yield Zotero.Libraries.setVersion(this.libraryID, json.libraryVersion);
|
this.library.libraryVersion = json.libraryVersion;
|
||||||
|
yield this.library.save();
|
||||||
objectsClass.updateVersion(ids, json.libraryVersion);
|
objectsClass.updateVersion(ids, json.libraryVersion);
|
||||||
objectsClass.updateSynced(ids, true);
|
objectsClass.updateSynced(ids, true);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
@ -940,7 +943,8 @@ Zotero.Sync.Data.Engine.prototype._upgradeCheck = Zotero.Promise.coroutine(funct
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark library as requiring full sync
|
// Mark library as requiring full sync
|
||||||
yield Zotero.Libraries.setVersion(this.libraryID, -1);
|
this.library.libraryVersion = -1;
|
||||||
|
yield this.library.save();
|
||||||
|
|
||||||
// If this is the last classic sync library, delete old timestamps
|
// If this is the last classic sync library, delete old timestamps
|
||||||
if (!(yield Zotero.DB.valueQueryAsync("SELECT COUNT(*) FROM libraries WHERE version=0"))) {
|
if (!(yield Zotero.DB.valueQueryAsync("SELECT COUNT(*) FROM libraries WHERE version=0"))) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user