Closed
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 versions of Parse Server and the Parse JS SDK.
Issue Description
Pending operations on nested fields of depth at least two get re-done for every call to .get()
Steps to reproduce
- Create an object with a double-nested integer field:
const obj = new TestObject();
obj.set('objectField', { foo: { bar: 5 } });
- Save the object to create it:
await obj.save();
- Increment the nested field:
obj.increment('objectField.foo.bar', 15);
- Read its value twice:
assert.equal(obj.get('objectField').foo.bar, 20);
assert.equal(obj.get('objectField').foo.bar, 20);
Actual Outcome
The first assert succeeds, the second fails with 35 != 20
Note that without the call to .save()
, even the first assert fails with 15 != 20, which might be a separate issue.
Expected Outcome
Both asserts should succeed
Environment
Server
- Parse Server version:
4.5.0
- Operating system:
Ubuntu 20.04
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
v4.4.5
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- Parse JS SDK version:
master
as of 14 May