Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toJSON() repeats pending updates to nested keys #1452

Closed
4 tasks done
mstniy opened this issue Feb 16, 2022 · 6 comments · Fixed by #1453
Closed
4 tasks done

toJSON() repeats pending updates to nested keys #1452

mstniy opened this issue Feb 16, 2022 · 6 comments · Fixed by #1453
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@mstniy
Copy link
Contributor

mstniy commented Feb 16, 2022

New Issue Checklist

Issue Description

If there are pending updates to nested fields, the object returned by toJSON() is corrupted.

Steps to reproduce

a = new Parse.Object("MyObject");
a.set('obj', {});
await a.save();
a.set('obj.a', 0);
console.log(a.toJSON());

Actual Outcome

Prints an object with the keys {obj: {a: 0}, 'obj.a': 0}

Expected Outcome

Should print roughly {obj: {a: 0}}

Environment

Server

  • Parse Server version: irrelevant
  • 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: 5.0.6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • Parse JS SDK version: alpha (d084ac9be058d9b13f8ac2bbf04615f76dc2800d)

Logs

@parse-github-assistant
Copy link

parse-github-assistant bot commented Feb 16, 2022

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Feb 16, 2022
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Feb 16, 2022
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Feb 16, 2022
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Feb 16, 2022
@mtrezza
Copy link
Member

mtrezza commented Feb 16, 2022

Did you mix expected and actual outcome?

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Feb 16, 2022
@mstniy
Copy link
Contributor Author

mstniy commented Feb 16, 2022

Whoops. Fixed.

mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Dec 19, 2023
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Dec 19, 2023
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Dec 19, 2023
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue Dec 19, 2023
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue May 2, 2024
mstniy added a commit to Ocell-io/Parse-SDK-JS that referenced this issue May 2, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0-alpha.8

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label May 2, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label May 16, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
3 participants