-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: Error when updating ParseObject with relation to another object #805
Conversation
Thanks for opening this pull request!
|
I just noticed you changed some links in the template, I will correct that. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
==========================================
- Coverage 26.71% 22.11% -4.61%
==========================================
Files 47 47
Lines 2905 2908 +3
==========================================
- Hits 776 643 -133
- Misses 2129 2265 +136
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
I was testing my code, it introduces other problems. Please, do not merge this version. I'll send another version of it. I'm already working on it! |
This reverts commit 4e48925
It should work now 😁 Let me know!! |
I will reformat the title to use the proper commit message syntax. |
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.
The code has been tested, it seems good.
@juriSacchetta is it possible to add the test?
At the moment, I didn't write a test but I've tested it inside my project. It seems to work fine. Maybe in the next few days, I'll write one. I can't guarantee it, my schedule is very busy sorry. |
Thanks for your feedback, we'll keep this open until a test is added. |
Hey guys I added a new test relation specific. Let me know if it can be enough :) |
Rebased and started CI |
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.
Tests are not like other tests, please write like other samples
Please write based on this file
06f9f69
to
92770f8
Compare
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.
The rest of the parts are fine, just move the duplicate codes to the setup section
Hi , please i keep getting this issue "Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'ParseRelation?' in type cast" how dp i fix it? |
@xanderelsmith is this related to this PR? |
This issue is not related to this section. Please open an issue if you have a problem |
Hey there! |
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.
It was tested and there is no problem
No, it has not been merged yet |
Yes |
@xanderelsmith How is it related to this PR? Could you give more details? |
It throws an error, when removing a parse object from a parse relation |
You said something about the data becoming a map once |
This🤲 |
Hey guys, I tested this code version and it seems to work fine for me. @xanderelsmith can you give me more details? |
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.
Thanks for your contribution @juriSacchetta, I'm working to fix this issue and other issues related to using Map
s to store the operations, I'm using a more OOP approach to improve and fix all of them using ParseOperations
, and the ParseMergeTool
class will be removed. I will definitely take a look at your code and see if I use any of it. Thanks again for your work.
Here is my PR: #860
@parse-community/flutter-sdk-review, I'd like to request that we don't merge this pull request just yet. Can we hold off for a bit? I'm working on a more comprehensive solution.
Thanks
Fine with me, @mbfakourii what do you think? Do you have an ETA for the other PR you're working on? If it takes longer, another possibility may be to merge this for a quick fix and mere the comprehensive fix later on. |
I'm currently working on the I think I need a week or less.
Sure, that sounds good. Give me some time to review and test this PR. |
This is a breaking change! I'm sorry, but it's not a quick fix anymore. |
Can you update your master branch to be in sync with upstream, so you can see the added tests? I just checked out your master and pulled the test files from upstream, and the tests are reporting syntax errors and failing. |
I think it is good and there is no problem |
Hi guys, I really need this fix as soon as possible. This solution would be perfect for me. Thank you for your work 😁 |
We are working on it! You can just use the SDK as an embedded package in your project and import it using its here is a code snippte: parse_server_sdk_flutter:
path: ./Parse-SDK-Flutter/packages/flutter |
Completed via #860 |
New Pull Request Checklist
Issue Description
Closes: #696
If you try to add a relationship to an object and after you do another operation to it you'll face this error:
By adding a relation, the set method of ParseObject changes the value corresponding to the key. Thus, the next time the relation is attempted, there will be no instance of ParseRelation but a Map.
Approach
To solve this bug, I had to insert an if within the set method, but it is not a clean solution. I could not find a better solution. Honestly, I think using the same map to store both data and operations is a risky decision.
The last change concerns the creation of a relation in the client.
Every time the relation was accessed, a new one was created, thus also losing the cache function that was already implemented.
I tried to always return the same instance.
TODOs before merging