mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-25 04:06:14 +00:00
Update various registration related logs as keep-longer.
This commit is contained in:
committed by
Greyson Parrelli
parent
4179592ae7
commit
6e5c569f7e
@@ -248,7 +248,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
store.update {
|
||||
it.copy(fcmToken = fcmToken)
|
||||
}
|
||||
Log.d(TAG, "FCM token fetched.")
|
||||
Log.d(TAG, "FCM token fetched.", true)
|
||||
return fcmToken
|
||||
}
|
||||
|
||||
@@ -461,9 +461,9 @@ class RegistrationViewModel : ViewModel() {
|
||||
|
||||
viewModelScope.launch {
|
||||
val session = getOrCreateValidSession(context) ?: return@launch bail { Log.i(TAG, "Could not create valid session for submitting a captcha token.") }
|
||||
Log.d(TAG, "Submitting captcha token…")
|
||||
Log.d(TAG, "Submitting captcha token…", true)
|
||||
val captchaSubmissionResult = RegistrationRepository.submitCaptchaToken(context, e164, password, session.sessionId, captchaToken)
|
||||
Log.d(TAG, "Captcha token submitted.")
|
||||
Log.d(TAG, "Captcha token submitted.", true)
|
||||
|
||||
handleSessionStateResult(context, captchaSubmissionResult)
|
||||
}
|
||||
@@ -486,7 +486,7 @@ 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.")
|
||||
Log.d(TAG, "Push challenge token submitted.", true)
|
||||
handleSessionStateResult(context, pushSubmissionResult)
|
||||
}
|
||||
}
|
||||
@@ -517,7 +517,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
}
|
||||
|
||||
is ChallengeRequired -> {
|
||||
Log.d(TAG, "[${sessionResult.challenges.joinToString()}] registration challenges received.")
|
||||
Log.d(TAG, "[${sessionResult.challenges.joinToString()}] registration challenges received.", true)
|
||||
store.update {
|
||||
it.copy(
|
||||
registrationCheckpoint = RegistrationCheckpoint.CHALLENGE_RECEIVED,
|
||||
@@ -550,7 +550,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "Request verification code rate limit is forever, need to start new session")
|
||||
Log.w(TAG, "Request verification code rate limit is forever, need to start new session", true)
|
||||
SignalStore.registration.sessionId = null
|
||||
store.update { RegistrationState() }
|
||||
}
|
||||
@@ -589,7 +589,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
var stayInProgress = false
|
||||
when (registrationResult) {
|
||||
is RegisterAccountResult.Success -> {
|
||||
Log.i(TAG, "Register account result: Success! Registration lock: $reglockEnabled")
|
||||
Log.i(TAG, "Register account result: Success! Registration lock: $reglockEnabled", true)
|
||||
store.update {
|
||||
it.copy(
|
||||
registrationCheckpoint = RegistrationCheckpoint.SERVICE_REGISTRATION_COMPLETED
|
||||
@@ -605,7 +605,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
}
|
||||
|
||||
is RegisterAccountResult.RegistrationLocked -> {
|
||||
Log.i(TAG, "Account is registration locked!", registrationResult.getCause())
|
||||
Log.i(TAG, "Account is registration locked!", registrationResult.getCause(), true)
|
||||
stayInProgress = true
|
||||
}
|
||||
|
||||
@@ -735,11 +735,11 @@ class RegistrationViewModel : ViewModel() {
|
||||
registrationResult = RegisterAccountResult.Success(registrationResult.accountRegistrationResult.copy(masterKey = masterKey))
|
||||
}
|
||||
|
||||
Log.i(TAG, "Received a non-registration lock response to registration. Assuming registration lock as DISABLED")
|
||||
Log.i(TAG, "Received a non-registration lock response to registration. Assuming registration lock as DISABLED", true)
|
||||
return Pair(registrationResult, false)
|
||||
}
|
||||
|
||||
Log.i(TAG, "Received a registration lock response when trying to register an account. Retrying with master key.")
|
||||
Log.i(TAG, "Received a registration lock response when trying to register an account. Retrying with master key.", true)
|
||||
store.update {
|
||||
it.copy(
|
||||
svr2AuthCredentials = registrationResult.svr2Credentials,
|
||||
@@ -802,14 +802,14 @@ class RegistrationViewModel : ViewModel() {
|
||||
if (session.verified) {
|
||||
Log.i(TAG, "Session is already verified, registering account.")
|
||||
} else {
|
||||
Log.d(TAG, "Submitting verification code…")
|
||||
Log.d(TAG, "Submitting verification code…", true)
|
||||
|
||||
val verificationResponse = RegistrationRepository.submitVerificationCode(context, sessionId, registrationData)
|
||||
|
||||
val submissionSuccessful = verificationResponse is Success
|
||||
val alreadyVerified = verificationResponse is AlreadyVerified
|
||||
|
||||
Log.d(TAG, "Verification code submission network call completed. Submission successful? $submissionSuccessful Account already verified? $alreadyVerified")
|
||||
Log.d(TAG, "Verification code submission network call completed. Submission successful? $submissionSuccessful Account already verified? $alreadyVerified", true)
|
||||
|
||||
if (!submissionSuccessful && !alreadyVerified) {
|
||||
handleSessionStateResult(context, verificationResponse)
|
||||
@@ -898,7 +898,7 @@ class RegistrationViewModel : ViewModel() {
|
||||
}
|
||||
|
||||
private suspend fun onSuccessfulRegistration(context: Context, registrationData: RegistrationData, remoteResult: AccountRegistrationResult, reglockEnabled: Boolean) = withContext(Dispatchers.IO) {
|
||||
Log.v(TAG, "onSuccessfulRegistration()")
|
||||
Log.v(TAG, "onSuccessfulRegistration()", true)
|
||||
val metadata = LocalRegistrationMetadataUtil.createLocalRegistrationMetadata(SignalStore.account.aciIdentityKey, SignalStore.account.pniIdentityKey, registrationData, remoteResult, reglockEnabled)
|
||||
SignalStore.registration.localRegistrationMetadata = metadata
|
||||
RegistrationRepository.registerAccountLocally(context, metadata)
|
||||
|
||||
@@ -57,7 +57,7 @@ class EnterBackupKeyViewModel : ViewModel() {
|
||||
fun handleRegistrationFailure(registerAccountResult: RegisterAccountResult) {
|
||||
store.update {
|
||||
if (it.isRegistering) {
|
||||
Log.w(TAG, "Unable to register [${registerAccountResult::class.simpleName}]", registerAccountResult.getCause())
|
||||
Log.w(TAG, "Unable to register [${registerAccountResult::class.simpleName}]", registerAccountResult.getCause(), true)
|
||||
val incorrectKeyError = registerAccountResult is RegisterAccountResult.IncorrectRecoveryPassword
|
||||
|
||||
if (incorrectKeyError && SignalStore.account.restoredAccountEntropyPool) {
|
||||
|
||||
@@ -102,7 +102,7 @@ class RemoteRestoreViewModel(isOnlyRestoreOption: Boolean) : ViewModel() {
|
||||
|
||||
when (val result = BackupRepository.restoreRemoteBackup()) {
|
||||
RemoteRestoreResult.Success -> {
|
||||
Log.i(TAG, "Restore successful")
|
||||
Log.i(TAG, "Restore successful", true)
|
||||
SignalStore.registration.restoreDecisionState = RestoreDecisionState.Completed
|
||||
|
||||
StorageServiceRestore.restore()
|
||||
@@ -111,18 +111,18 @@ class RemoteRestoreViewModel(isOnlyRestoreOption: Boolean) : ViewModel() {
|
||||
}
|
||||
|
||||
RemoteRestoreResult.NetworkError -> {
|
||||
Log.w(TAG, "Restore failed to download")
|
||||
Log.w(TAG, "Restore failed to download", true)
|
||||
store.update { it.copy(importState = ImportState.NetworkFailure) }
|
||||
}
|
||||
|
||||
RemoteRestoreResult.Canceled,
|
||||
RemoteRestoreResult.Failure -> {
|
||||
Log.w(TAG, "Restore failed with $result")
|
||||
Log.w(TAG, "Restore failed with $result", true)
|
||||
store.update { it.copy(importState = ImportState.Failed) }
|
||||
}
|
||||
|
||||
RemoteRestoreResult.PermanentSvrBFailure -> {
|
||||
Log.w(TAG, "Hit a permanent SVRB error.")
|
||||
Log.w(TAG, "Hit a permanent SVRB error.", true)
|
||||
store.update { it.copy(importState = ImportState.FailureWithLogPrompt) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class RestoreViaQrViewModel : ViewModel() {
|
||||
if (isActive) {
|
||||
startNewSocket()
|
||||
count++
|
||||
Log.d(TAG, "Started next websocket count: $count")
|
||||
Log.d(TAG, "Started next websocket count: $count", true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ class RestoreViaQrViewModel : ViewModel() {
|
||||
fun handleRegistrationFailure(registerAccountResult: RegisterAccountResult) {
|
||||
store.update {
|
||||
if (it.isRegistering) {
|
||||
Log.w(TAG, "Unable to register [${registerAccountResult::class.simpleName}]", registerAccountResult.getCause())
|
||||
Log.w(TAG, "Unable to register [${registerAccountResult::class.simpleName}]", registerAccountResult.getCause(), true)
|
||||
it.copy(
|
||||
isRegistering = false,
|
||||
provisioningMessage = null,
|
||||
@@ -140,7 +140,7 @@ class RestoreViaQrViewModel : ViewModel() {
|
||||
) { socket ->
|
||||
val url = socket.getProvisioningUrl()
|
||||
store.update {
|
||||
Log.d(TAG, "Updating QR code with data from [${socket.id}]")
|
||||
Log.d(TAG, "Updating QR code with data from [${socket.id}]", true)
|
||||
|
||||
it.copy(
|
||||
currentSocketId = socket.id,
|
||||
|
||||
Reference in New Issue
Block a user