Add KEYS_WITHHELD error type to analytics

This commit is contained in:
ariskotsomitopoulos 2022-04-21 19:31:12 +03:00
parent cc705d5458
commit e368046b84

View File

@ -39,6 +39,7 @@ private data class DecryptionFailure(
val error: MXCryptoError.ErrorType
)
private typealias DetailedErrorName = Pair<String, Error.Name>
private const val GRACE_PERIOD_MILLIS = 4_000
private const val CHECK_INTERVAL = 2_000L
@ -145,7 +146,8 @@ class DecryptionFailureTracker @Inject constructor(
private fun MXCryptoError.ErrorType.toAnalyticsErrorName(): DetailedErrorName {
val detailed = "$name | mxc_crypto_error_type"
return when (this) {
MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID -> Pair(detailed, Error.Name.OlmKeysNotSentError)
MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID,
MXCryptoError.ErrorType.KEYS_WITHHELD -> Pair(detailed, Error.Name.OlmKeysNotSentError)
MXCryptoError.ErrorType.OLM -> Pair(detailed, Error.Name.OlmUnspecifiedError)
MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX -> Pair(detailed, Error.Name.OlmIndexError)
else -> Pair(detailed, Error.Name.UnknownError)