From 1962b965fde31fa629e3ebdb9303a9cd0c29a175 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Apr 2026 10:12:03 +0200 Subject: [PATCH] Improve log and reduce severity. --- .../impl/classic/ElementClassicConnection.kt | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt index e360aff376..393762fed2 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt @@ -107,7 +107,7 @@ class DefaultElementClassicConnection( } override fun start() { - Timber.tag(loggerTag.value).w("start()") + Timber.tag(loggerTag.value).d("start()") coroutineScope.launch { // Establish a connection with the service. We use an explicit // class name because there is no reason to be able to let other @@ -130,7 +130,7 @@ class DefaultElementClassicConnection( } override fun stop() { - Timber.tag(loggerTag.value).w("stop(): Unbinding (bound=$bound)") + Timber.tag(loggerTag.value).d("stop(): Unbinding (bound=$bound)") if (bound) { // Detach our existing connection. serviceBinder.unbindService(serviceConnection) @@ -142,13 +142,12 @@ class DefaultElementClassicConnection( } override fun requestSession() { - Timber.tag(loggerTag.value).w("requestSession()") + Timber.tag(loggerTag.value).d("requestSession()") coroutineScope.launch { val finalMessenger = messenger if (finalMessenger == null) { - Timber.tag(loggerTag.value).w("The messenger is null, can't request data") + Timber.tag(loggerTag.value).d("The messenger is null, can't request data") // Do not emit error, else the regular on boarding flow will be displayed - // emitState(ElementClassicConnectionState.Error("The messenger is null, can't request data")) } else { try { // Get the data @@ -168,7 +167,7 @@ class DefaultElementClassicConnection( } override fun requestAvatar(userId: UserId) { - Timber.tag(loggerTag.value).w("requestAvatar()") + Timber.tag(loggerTag.value).d("requestAvatar()") coroutineScope.launch { val finalMessenger = messenger if (finalMessenger == null) { @@ -265,7 +264,7 @@ class DefaultElementClassicConnection( if (isCompatible) { Timber.tag(loggerTag.value).d("Found compatible homeserver URL: %s", url) } else { - Timber.tag(loggerTag.value).w("Homeserver URL is not compatible: %s", url) + Timber.tag(loggerTag.value).d("Homeserver URL is not compatible: %s", url) } isCompatible } @@ -334,6 +333,16 @@ class DefaultElementClassicConnection( val doesContainBackupKey = secrets != null && roomKeysVersion != null && matrixAuthenticationService.doSecretsContainBackupKey(userId, secrets, roomKeysVersion) + Timber.tag(loggerTag.value).d( + buildString { + append("Receiving session $userId ($displayName) from Element Classic, with secrets: ") + append(secrets != null) + append(", with roomKeysVersion: ") + append(roomKeysVersion != null) + append(", with valid backup key: ") + append(doesContainBackupKey) + } + ) ElementClassicConnectionState.ElementClassicReady( elementClassicSession = ElementClassicSession( userId = userId,