Closed shlusiak closed 2 years ago
@shlusiak can you check please the failing test
com.parse.ParseUserTest > testSaveAsyncWithLazyAndCurrentUser FAILED
1579
java.lang.AssertionError at ParseUserTest.java:962
@L3K0V I think I fixed the failing test. Let's see if it passes now.
Merging #1136 (4bc9067) into master (1844b3e) will decrease coverage by
0.01%
. The diff coverage is100.00%
.
@@ 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
Impacted Files | Coverage Δ | |
---|---|---|
parse/src/main/java/com/parse/ParseUser.java | 82.42% <100.00%> (-0.21%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 301c29b...4bc9067. Read the comment docs.
@mtrezza LGTM
🎉 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.