Abort re-reg with pin flow if unable to communicate via svr websocket.

This commit is contained in:
Cody Henthorne
2025-12-18 14:55:45 -05:00
committed by jeffrey-signal
parent 9db33c3fec
commit 26b8de2282

View File

@@ -96,6 +96,7 @@ import org.whispersystems.signalservice.internal.push.AuthCredentials
import org.whispersystems.signalservice.internal.push.ProvisionMessage
import org.whispersystems.signalservice.internal.push.SyncMessage
import java.io.IOException
import java.net.ProtocolException
import java.nio.charset.StandardCharsets
import kotlin.jvm.optionals.getOrNull
import kotlin.math.max
@@ -692,6 +693,14 @@ class RegistrationViewModel : ViewModel() {
Log.w(TAG, "SVR has no data for these credentials. Aborting skip SMS flow.", noData)
updateSvrTriesRemaining(0)
setUserSkippedReRegisterFlow(true)
} catch (ioe: IOException) {
if (ioe.cause is ProtocolException) {
Log.w(TAG, "Network error attempting to communicate with SVR, likely web socket http protocol exception. Skipping re-reg", ioe)
setUserSkippedReRegisterFlow(true)
} else {
Log.w(TAG, "Network error attempting to communicate with SVR.", ioe)
handleGenericError(ioe)
}
}
}
return