Skip to content
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 to delete user when unregister for notifications failed #3454

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOvera
@Override
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
Log.e(TAG, "error while trying to unregister Device For Notifications", e);
initiateUserDeletion(user);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

especially this missing deletion command caused bugs..

}

@Override
Expand All @@ -137,7 +138,7 @@ public void onComplete() {
}
});
} else {
deleteUser(user);
initiateUserDeletion(user);
}
}

Expand Down Expand Up @@ -172,15 +173,13 @@ public void onNext(Void aVoid) {
}
}

if (user.getId() != null) {
WebSocketConnectionHelper.deleteExternalSignalingInstanceForUserEntity(user.getId());
}
deleteAllEntriesForAccountIdentifier(user);
initiateUserDeletion(user);
}

@Override
public void onError(Throwable e) {
Log.e(TAG, "error while trying to unregister Device For Notification With Proxy", e);
initiateUserDeletion(user);
}

@Override
Expand All @@ -190,8 +189,10 @@ public void onComplete() {
});
}

private void deleteAllEntriesForAccountIdentifier(User user) {
private void initiateUserDeletion(User user) {
if (user.getId() != null) {
WebSocketConnectionHelper.deleteExternalSignalingInstanceForUserEntity(user.getId());

try {
arbitraryStorageManager.deleteAllEntriesForAccountIdentifier(user.getId());
deleteUser(user);
Expand Down
Loading