Closed as not planned
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
obj.increment does not appear to be atomic.
Steps to reproduce
I have the following code in the beforeSave hook of "childClass" and child has a pointer "parent" to "parentClass".
await obj.get("parent").increment("number_children").save(null, {
useMasterKey: true,
});
Actual Outcome
Creating two child objects simultaneously results in "number_children" increasing from 0 to 1.
This does not happen with:
await obj1.save();
await obj2.save();
but only with
await Promise.all(obj1.save(), obj2.save());
Expected Outcome
I expected the count to increase from 0 to 2.
Environment
Server
- Parse Server version:
6.2.2
- Operating system:
MacOS Ventura
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
6.0.10
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
js
- SDK version:
4.2.0