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

Local state of objects not correct if setting multiple properties #2115

Closed
4 tasks done
mortenmo opened this issue Apr 27, 2024 · 2 comments
Closed
4 tasks done

Local state of objects not correct if setting multiple properties #2115

mortenmo opened this issue Apr 27, 2024 · 2 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@mortenmo
Copy link
Contributor

New Issue Checklist

Issue Description

When looking at #1798 found that setting multiple properties on the same object locally without saving reports the wrong object back. It will only show (this is true for set and unset) the latest Op you added to that property and not all. So setting data.b and data.c without saving (or you're offline), causes data.b to not be set.

When the object gets saved, the properties show up on get as expected.

Steps to reproduce

const myObj = new Parse.Object('MyClass');
myObj.set('data', {a: 5});
await myObj.save(null, {useMasterKey: true});

myObj.set('data.b', 2);
myObj.set('data.c', 2);

console.log(myObj.get('data'));

Actual Outcome

{ a: 5, c: 2}

Expected Outcome

{ a: 5, b: 2, c: 2}

Environment

Server

  • Parse Server version: 7.0.0
  • Operating system: OSX
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Client

  • Parse JS SDK version: 5.0.0
Copy link

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.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Apr 27, 2024
@dplewis
Copy link
Member

dplewis commented May 3, 2024

Completed via #1451

@dplewis dplewis closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants