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

fix: Calling Parse.Object.relation.add multiple times adds only the first object #2078

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

mstniy
Copy link
Contributor

@mstniy mstniy commented Jan 21, 2024

Pull Request

Issue

Closes: #2056

Approach

ParseOp.applyTo: Take as parameter not just the className and objectId, but the whole object.
This allows ObjectStateMutations.estimateAttributes to return relations with correct parents

Tasks

  • Add tests

Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: relation double-add bug (#2056), new approach fix: Relation double-add bug (#2056), new approach Jan 21, 2024
Copy link

Thanks for opening this pull request!

Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (eff6932) 100.00% compared to head (8969f0b) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2078   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           61        61           
  Lines         6178      6173    -5     
  Branches      1496      1494    -2     
=========================================
- Hits          6178      6173    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase this onto the base branch; you apparently disabled changes by maintainers, so we cannot do it for you.

@mstniy
Copy link
Contributor Author

mstniy commented Feb 15, 2024

Done @mtrezza .

Weird that this is how it is set up. I did not explicitly disable it.

@mtrezza mtrezza changed the title fix: Relation double-add bug (#2056), new approach fix: Calling Parse.Object.relation.add multiple times adds only the first object Feb 15, 2024
@mtrezza mtrezza merged commit 0f98117 into parse-community:alpha Feb 15, 2024
11 checks passed
@mstniy mstniy deleted the relation_fix2 branch February 15, 2024 12:36
parseplatformorg pushed a commit that referenced this pull request Feb 15, 2024
## [4.3.1-alpha.2](4.3.1-alpha.1...4.3.1-alpha.2) (2024-02-15)

### Bug Fixes

* Calling `Parse.Object.relation.add` multiple times adds only the first object ([#2078](#2078)) ([0f98117](0f98117))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.3.1-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 15, 2024
parseplatformorg pushed a commit that referenced this pull request Mar 17, 2024
# [5.0.0-beta.1](4.3.1...5.0.0-beta.1) (2024-03-17)

### Bug Fixes

* Calling `Parse.Object.relation.add` multiple times adds only the first object ([#2078](#2078)) ([0f98117](0f98117))

### Features

* Add comment to MongoDB query via `Parse.Query.comment` ([#2088](#2088)) ([a970913](a970913))
* Add compatibility with Parse Server 7 ([#2089](#2089)) ([86600bc](86600bc))
* Add support for Node 20, remove support for Node 14 and 16 ([#2063](#2063)) ([74eb4d5](74eb4d5))

### BREAKING CHANGES

* Parse JS SDK 5 requires Parse Server 7 and is incompatible with Parse Server 6. ([86600bc](86600bc))
* Removes support for Node 14 and 16. ([74eb4d5](74eb4d5))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Mar 17, 2024
parseplatformorg pushed a commit that referenced this pull request Mar 17, 2024
# [5.0.0](4.3.1...5.0.0) (2024-03-17)

### Bug Fixes

* Calling `Parse.Object.relation.add` multiple times adds only the first object ([#2078](#2078)) ([0f98117](0f98117))

### Features

* Add comment to MongoDB query via `Parse.Query.comment` ([#2088](#2088)) ([a970913](a970913))
* Add compatibility with Parse Server 7 ([#2089](#2089)) ([86600bc](86600bc))
* Add support for Node 20, remove support for Node 14 and 16 ([#2063](#2063)) ([74eb4d5](74eb4d5))

### BREAKING CHANGES

* Parse JS SDK 5 requires Parse Server 7 and is incompatible with Parse Server 6. ([86600bc](86600bc))
* Removes support for Node 14 and 16. ([74eb4d5](74eb4d5))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 17, 2024
mtrezza added a commit to mtrezza/Parse-SDK-JS that referenced this pull request Mar 23, 2024
…rification

* alpha:
  chore(release): 5.0.0-beta.1 [skip ci]
  chore(release): 5.0.0-alpha.3 [skip ci]
  feat: Add comment to MongoDB query via `Parse.Query.comment` (parse-community#2088)
  chore(release): 5.0.0-alpha.2 [skip ci]
  feat: Add compatibility with Parse Server 7 (parse-community#2089)
  chore(release): 5.0.0-alpha.1 [skip ci]
  feat: Add support for Node 20, remove support for Node 14 and 16 (parse-community#2063)
  refactor: Upgrade ws from 8.15.1 to 8.16.0 (parse-community#2087)
  ci: Remove manual caching for `actions/setup-node` (parse-community#2064)
  chore(release): 4.3.1-alpha.2 [skip ci]
  fix: Calling `Parse.Object.relation.add` multiple times adds only the first object (parse-community#2078)
  refactor: Upgrade ws from 8.15.0 to 8.15.1 (parse-community#2074)
  chore(release): 4.3.1 [skip ci]
  release
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling .add multiple times on relations is broken
3 participants