Cleanup and little change on Throwable logging

This commit is contained in:
Benoit Marty 2020-02-05 11:39:23 +01:00
parent ed9c3379bf
commit a17ec14dd7
9 changed files with 13 additions and 7 deletions

View file

@ -1,5 +1,6 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View file

@ -59,7 +59,7 @@ class RoomMemberCountCondition(val iz: String) : Condition(Kind.room_member_coun
val (prefix, count) = match.destructured
return prefix to count.toInt()
} catch (t: Throwable) {
Timber.d(t)
Timber.e(t, "Unable to parse 'is' field")
}
return null
}

View file

@ -393,7 +393,7 @@ internal class DefaultCrossSigningService @Inject constructor(
return@forEach
} catch (failure: Throwable) {
// log
Timber.v(failure)
Timber.w(failure, "Signature not valid?")
}
}
}

View file

@ -414,7 +414,7 @@ internal class KeysBackup @Inject constructor(
olmDevice.verifySignature(fingerprint, authData.signalableJSONDictionary(), mySignature)
isSignatureValid = true
} catch (e: OlmException) {
Timber.v(e, "getKeysBackupTrust: Bad signature from device ${device.deviceId}")
Timber.w(e, "getKeysBackupTrust: Bad signature from device ${device.deviceId}")
}
}

View file

@ -66,6 +66,11 @@ internal abstract class SessionModule {
companion object {
internal fun getKeyAlias(userMd5: String) = "session_db_$userMd5"
/**
* Rules:
* Annotate methods with @SessionScope only the @Provides annotated methods with computation and logic.
*/
@JvmStatic
@Provides
fun providesHomeServerConnectionConfig(sessionParams: SessionParams): HomeServerConnectionConfig {

View file

@ -51,8 +51,8 @@ internal class RoomSummaryUpdater @Inject constructor(
private val roomAvatarResolver: RoomAvatarResolver,
private val monarchy: Monarchy) {
// TODO: maybe allow user of SDK to give that list
companion object {
// TODO: maybe allow user of SDK to give that list
val PREVIEWABLE_TYPES = listOf(
// TODO filter message type (KEY_VERIFICATION_READY, etc.)
EventType.MESSAGE,

View file

@ -110,7 +110,7 @@ internal class TimelineEventDecryptor(
eventEntity.setDecryptionResult(result)
}
} catch (e: MXCryptoError) {
Timber.v(e, "Failed to decrypt event $eventId")
Timber.w(e, "Failed to decrypt event $eventId")
if (e is MXCryptoError.Base && e.errorType == MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID) {
// Keep track of unknown sessions to automatically try to decrypt on new session
realm.executeTransaction {

View file

@ -174,7 +174,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
Timber.v("Cancelled")
} else if (failure.isTokenError()) {
// No token or invalid token, stop the thread
Timber.w(failure)
Timber.w(failure, "Token error")
isStarted = false
isTokenValid = false
} else {

View file

@ -47,7 +47,7 @@ internal class TaskExecutor @Inject constructor(private val coroutineDispatchers
}
resultOrFailure
.onFailure {
Timber.d(it, "Task failed")
Timber.e(it, "Task failed")
}
.foldToCallback(task.callback)
}