Skip to content

Nested pointer updates don't work #7391

@mstniy

Description

@mstniy

New Issue Checklist

Issue Description

Updates to nested pointers don't work.

Steps to reproduce

  1. 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();
  1. Update the nested pointer
obj.set('data.ptr', ptr2);
await obj.save();
  1. 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: master as 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions