-
-
Notifications
You must be signed in to change notification settings - Fork 735
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: failed signup attempt with anonymous ParseUser leaves it in inconsistent state #1136
fix: failed signup attempt with anonymous ParseUser leaves it in inconsistent state #1136
Conversation
Thanks for opening this pull request!
|
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.
@shlusiak great job again, LGTM!
@shlusiak can you check please the failing test
|
@L3K0V I think I fixed the failing test. Let's see if it passes now. |
Codecov Report
@@ Coverage Diff @@
## master #1136 +/- ##
============================================
- Coverage 65.31% 65.30% -0.02%
+ Complexity 2219 2218 -1
============================================
Files 122 122
Lines 9961 9961
Branches 1338 1338
============================================
- Hits 6506 6505 -1
Misses 2943 2943
- Partials 512 513 +1
Continue to review full report at Codecov.
|
@mtrezza LGTM |
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.
Look good!
## [2.0.5](2.0.4...2.0.5) (2021-11-10) ### Bug Fixes * failed signup attempt with anonymous ParseUser leaves it in inconsistent state ([#1136](#1136)) ([ac6d9e0](ac6d9e0))
🎉 This change has been released in version 2.0.5 |
Issue Description
The key "authData" contains a
Map
of authentication related data. Because unfortunatelyestimatedData
is a shallow copy ofstate
, the object pointed to bystate["authData"]
andestimatedData["authData"]
is the same object. Modifying the data in this map directly prevents us from being able to callrevert()
to revert the data back to the server state.This is impotant e.g. when trying to revert the user after converting it from anonymous to registered fails, where anonymity has been stripped and there is no way to get it back.
Related issue: #401
Approach
This would just create another (shallow) copy of "authData", which in this case would be fine, because we are only modifying the first layer. By replacing the value of the map with a new map we ensure that the values in
state
andestimatedData
are different and thatrevert()
works.