-
-
Notifications
You must be signed in to change notification settings - Fork 594
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 on an on object does not work
#2057
Conversation
Thanks for opening this pull request! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #2057 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 61 61
Lines 6178 6175 -3
Branches 1496 1494 -2
=========================================
- Hits 6178 6175 -3 ☔ View full report in Codecov by Sentry. |
52d8854
to
ddd9972
Compare
@@ -50,12 +50,9 @@ class ParseRelation { | |||
if (this.parent.id !== parent.id) { | |||
throw new Error('Internal Error. Relation retrieved from two different Objects.'); | |||
} | |||
} else if (parent.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what as the purpose of this parent.id
check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. My educated guess is that it checks if the parent has been saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we'd need to understand this logic better and the purpose of the parent.id
check before we remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Unfortunately my team doesn't have the capacity for that, but we'd be more than happy to review/discuss any findings in this direction.
Co-authored-by: Manuel <[email protected]> Signed-off-by: Kartal Kaan Bozdoğan <[email protected]>
Parse.Object.relation.add
multiple times on an on object does not work
Closing in favor of #2078 |
Pull Request
Issue
Closes: #2056
Approach
_ensureParentAndKey
writes a fresh parent reference to the relation object.Tasks