From 7089658356933e95eb42d786e1d70515c6b948f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:42:00 +0000 Subject: [PATCH] fix: crash when registering with a registered email - WPB-14566 (#2224) Co-authored-by: Christoph Aldrian Co-authored-by: Christoph Aldrian --- .../RegistationCredentialVerificationStrategy.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wire-ios-sync-engine/Source/Synchronization/Strategies/RegistationCredentialVerificationStrategy.swift b/wire-ios-sync-engine/Source/Synchronization/Strategies/RegistationCredentialVerificationStrategy.swift index 28eaee60f75..cbc2785e67a 100644 --- a/wire-ios-sync-engine/Source/Synchronization/Strategies/RegistationCredentialVerificationStrategy.swift +++ b/wire-ios-sync-engine/Source/Synchronization/Strategies/RegistationCredentialVerificationStrategy.swift @@ -81,8 +81,11 @@ extension RegistationCredentialVerificationStrategy: ZMSingleRequestTranscoder { error = NSError.invalidActivationCode(with: response) ?? NSError(userSessionErrorCode: .unknownError, userInfo: [:]) default: + // We can end up here because more than one request can be sent for a single action/phase. + // This is an issue in some other part of SyncEngine but as a quick fix we will log and abort here. let phaseString = registrationStatus.phase.map { "\($0)" } ?? "" - fatal("Error occurs for invalid phase: \(phaseString)") + WireLogger.authentication.error("Recieved unsuccessful response for invalid phase (\(phaseString))", attributes: .safePublic) + return assertionFailure("Error occurs for invalid phase: \(phaseString)") } registrationStatus.handleError(error) }