diff --git a/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalWorker.java index 940d6780d00..d2405f95e75 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalWorker.java @@ -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); } @Override @@ -137,7 +138,7 @@ public void onComplete() { } }); } else { - deleteUser(user); + initiateUserDeletion(user); } } @@ -172,10 +173,7 @@ public void onNext(Void aVoid) { } } - if (user.getId() != null) { - WebSocketConnectionHelper.deleteExternalSignalingInstanceForUserEntity(user.getId()); - } - deleteAllEntriesForAccountIdentifier(user); + initiateUserDeletion(user); } @Override @@ -190,8 +188,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);