parse-community / parse-community/parse-server
Nested pointer updates don't work
Open
Nobody has claimed this yet.
type:bug
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
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
Updates to nested pointers don't work.
Steps to reproduce
- Create a Parse object with a nested pointer:
const obj = new Parse.Object('GameScore'); // This object will include nested pointers
const ptr1 = new Parse.Object('GameScore');
await ptr1.save(); // Obtain a unique id
const ptr2 = new Parse.Object('GameScore');
await ptr2.save(); // Obtain a unique id
obj.set('data', { ptr: ptr1 });
await obj.save();
- Update the nested pointer
obj.set('data.ptr', ptr2);
await obj.save();
- Re-read the object's nested pointer field
const obj2 = await new Parse.Query('GameScore').get(obj.id);
expect(obj2.get('data').ptr.id).toBe(ptr2.id);
Actual Outcome
The update on the nested pointer does not take effect, so the assert fails.
Expected Outcome
The pointer should be updated as instructed.
Failing Test Case / Pull Request
- 🤩 I submitted a PR with a fix and a test case.
- 🧐 I submitted a PR with a failing test case.
Environment
Server
- Parse Server version:
masteras of 20 May 2021 - 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.6 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript - SDK version:
3.2.0
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test path is named. Start with the JavaScript reproduction in the issue and trace how Parse Server persists updates to nested pointer fields in MongoDB. Done means re-reading the object shows data.ptr referring to ptr2, with a regression test covering the update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100