File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1294,6 +1294,7 @@ private Task<Void> linkWithAsync(
1294
1294
public Task <Void > then (Task <Void > task ) throws Exception {
1295
1295
synchronized (mutex ) {
1296
1296
if (task .isFaulted () || task .isCancelled ()) {
1297
+ removeAuthData (authType );
1297
1298
restoreAnonymity (oldAnonymousData );
1298
1299
return task ;
1299
1300
}
Original file line number Diff line number Diff line change @@ -699,13 +699,13 @@ public void testlinkWithInBackgroundWithSaveAsyncFailure() throws Exception {
699
699
partialMockUser .linkWithInBackground (authType , authData );
700
700
linkTask .waitForCompletion ();
701
701
702
- // Make sure new authData is added
703
- assertSame (authData , partialMockUser .getAuthData ().get (authType ));
704
702
// Make sure we save the user
705
703
verify (partialMockUser , times (1 ))
706
704
.saveAsync (eq ("sessionTokenAgain" ), eq (false ), Matchers .<Task <Void >>any ());
707
705
// Make sure old authData is restored
708
706
assertSame (anonymousAuthData , partialMockUser .getAuthData ().get (ParseAnonymousUtils .AUTH_TYPE ));
707
+ // Make sure failed new authData is cleared
708
+ assertNull (partialMockUser .getAuthData ().get ("facebook" ));
709
709
// Verify exception
710
710
assertSame (saveException , linkTask .getError ());
711
711
}
You can’t perform that action at this time.
0 commit comments