Merge pull request #5819 from overleaf/jpa-chat-race

[chat] fix race condition of concurrent delete operations

GitOrigin-RevId: 149c5121791af54cd6c27c3458d81641fb522b3d
This commit is contained in:
Jakob Ackermann 2021-11-19 14:12:17 +01:00 committed by Copybot
parent fc086fba29
commit 05cb9c49bf

View file

@ -47,15 +47,15 @@ module.exports = ThreadManager = {
}
}
db.rooms.updateOne(
db.rooms.findOneAndUpdate(
query,
{ $set: update },
{ upsert: true },
function (error) {
{ upsert: true, returnDocument: 'after' },
function (error, result) {
if (error != null) {
return callback(error)
}
db.rooms.findOne(query, callback)
callback(null, result.value)
}
)
},