-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: add set() and auto merge updated properties with original #406
Conversation
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## main #406 +/- ##
==========================================
- Coverage 89.98% 89.95% -0.03%
==========================================
Files 159 158 -1
Lines 15130 15175 +45
==========================================
+ Hits 13615 13651 +36
- Misses 1515 1524 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
What does that mean? Could you give an example what the effect on a date value is? |
This is has been updated in the docs, it's not an issue. |
Could you point to where in the docs that is explained? Or do you mean it's not an issue anymore because date values are not affected anymore? |
The latter, there’s no issue with encoding/decoding dates |
New Pull Request Checklist
Issue Description
Developers need to call the
mergeable
instance property when they start to make updates to anParseObject
in order to use the Parse Servers "quirky patch". To have a local copy of the updated ParseObject merged with original, developers also need to implement themerge()
method. Ifmerge()
is not implemented, the developer can callfetch()
to get the merged updates.Related issue: #401
Approach
Build onto #315 and add a
set
method that developers can call on their objects which automatically creates amergeable
instance that can be merged with the original object without the developer implementingmerge()
. An example is below:If a developer chooses to not implement the
merge()
and depends on the new default merging in this PR they are choosing to incur more computational overhead on the respective client after the update is already saved. This is due to the extra encoding/decoding needed to discover and complete the merge. The overhead will most likely increase the larger theParseObject
. If a developer wants to skip the overhead, they should implementmerge()
on each of theirParseObjects
. The newset
method is below:TODOs before merging