Skip to content

Commit

Permalink
Fix weird test failure after c5cd38b
Browse files Browse the repository at this point in the history
The change in c5cd38b seems like it shouldn't have had any effect,
but creating an empty Set before yielding somehow avoided a race
condition with the subsequent updateSession call.
  • Loading branch information
dstillman committed Mar 29, 2018
1 parent c5cd38b commit 52c1249
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chrome/content/zotero/xpcom/server_connector.js
Expand Up @@ -164,17 +164,17 @@ Zotero.Server.Connector.SaveSession.prototype.update = async function (libraryID
};

Zotero.Server.Connector.SaveSession.prototype._addObjects = async function (objectType, objects) {
// Update the objects with the current target data, in case it changed since the save began
await this._updateObjects({
[objectType]: objects
});

if (!this._objects[objectType]) {
this._objects[objectType] = new Set();
}
for (let object of objects) {
this._objects[objectType].add(object);
}

// Update the objects with the current target data, in case it changed since the save began
await this._updateObjects({
[objectType]: objects
});
};

/**
Expand Down

0 comments on commit 52c1249

Please sign in to comment.