-
-
Notifications
You must be signed in to change notification settings - Fork 261
fix: ParseObject
Relations not working
#407
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
Conversation
- Changed the return time of `ConvertToJSON` to return "object" as we now use that one method to pass both primitive and complex datatypes like Dictionnary for Relations. - Implemented ConvertToJSON in ParseRelationOperations which now fixes Relations completely (Before, the related object would save but its pointer was never referenced)
Thanks for opening this pull request!
|
Here is a full implementation of examples How to Get Relations
How to Add Relations
How to Update Relations
How to Delete Relations
How to Manage Relations
|
ParseObject
Relations not working
I just noticed that there is no coverage report comment, even though we are uploading it... Parse-SDK-dotNET/.github/workflows/ci.yml Lines 46 to 50 in 9573619
Seems to be an issue with the coverage config, as the link points to Parse Server:
|
Does this require me to do something perhaps? |
I'm taking a look; it would be good to see the coverage before merging. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #407 +/- ##
==========================================
- Coverage 52.90% 48.00% -4.90%
==========================================
Files 105 106 +1
Lines 4699 6199 +1500
Branches 830 950 +120
==========================================
+ Hits 2486 2976 +490
- Misses 2024 2910 +886
- Partials 189 313 +124 ☔ View full report in Codecov by Sentry. |
Fixed the coverage issue. I think the low coverage of this PR is due to the fact that you changed lines which were not covered in the first place. You don't need to add tests for these lines, as that would be a huge effort. In any case, could you still look through the un-covered lines and see if there is any uncovered line that you want to cover in your PR? |
I see now. |
Sounds good, so this is ready for merge? |
Btw, what do you mean with "uneasy to mock"? The tests should be easy to write; do the tests in this repo use an actual Parse Server instance, or is that all mocked and therefore so complex to test? |
I would say, Yes.
Most of the tests do NOT. So, while writing basic tests in 'Test Mode' is generally straightforward, achieving comprehensive and realistic tests for relations, which accurately simulate server-side behavior, requires more stateful mocking . This is what I meant by 'uneasy to mock'. It is definitely doable though. |
Got it, we should add an actual Parse Server instance to run the tests. It's pretty easy to set this up, I've opened #408. |
## [4.0.2](4.0.1...4.0.2) (2025-02-02) ### Bug Fixes * `ParseObject` Relations not working ([#407](#407)) ([9af640a](9af640a))
🎉 This change has been released in version 4.0.2 |
Oh that'd be great! Thank you for that! |
This PR aims at fixing only Parse Relations and its related operations (Add, Set, etc..)
Changed the return type of
ConvertToJSON
to return "object" as we now use that one method to pass both primitive and complex datatypes like Dictionnary for Relations.Implemented
ConvertToJSON
in ParseRelationOperations which now fixes Relations completely (Before, the related object would save but its pointer was never referenced)Removed
Encode()
asConvertToJSON
is now the method called.Added Unit Tests.
Closes fix: Parse Relation not working #404
Closes Missing methods in Parse .NET SDK 4.0 #397