mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Cleanup and little change on Throwable logging
This commit is contained in:
parent
ed9c3379bf
commit
a17ec14dd7
9 changed files with 13 additions and 7 deletions
|
@ -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>
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -393,7 +393,7 @@ internal class DefaultCrossSigningService @Inject constructor(
|
|||
return@forEach
|
||||
} catch (failure: Throwable) {
|
||||
// log
|
||||
Timber.v(failure)
|
||||
Timber.w(failure, "Signature not valid?")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue