From dbb3c8def95a65a445003512f1534707e904aeb8 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Fri, 27 Mar 2026 13:30:06 -0400 Subject: [PATCH] Fall back to next challenge when push challenge fails during registration. Co-authored-by: Greyson Parrelli --- .../securesms/registration/ui/RegistrationViewModel.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/registration/ui/RegistrationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/registration/ui/RegistrationViewModel.kt index 2a17b811f2..10c5b28550 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/registration/ui/RegistrationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/registration/ui/RegistrationViewModel.kt @@ -499,7 +499,14 @@ class RegistrationViewModel : ViewModel() { Log.d(TAG, "Requesting push challenge token…") val pushSubmissionResult = RegistrationRepository.requestAndVerifyPushToken(context, session.sessionId, e164, password) Log.d(TAG, "Push challenge token submitted.", true) - handleSessionStateResult(context, pushSubmissionResult) + val success = handleSessionStateResult(context, pushSubmissionResult) + + if (!success) { + Log.i(TAG, "Push challenge was not successful, removing from challenge list to allow fallback.") + store.update { + it.copy(challengesRequested = it.challengesRequested.minus(Challenge.PUSH), inProgress = false) + } + } } }