Merge pull request #7304 from vector-im/andy/tracking_changes

Ensure E2EE never tracks UnknownError
This commit is contained in:
Anderas
2023-01-26 12:12:29 +00:00
committed by GitHub
4 changed files with 9 additions and 9 deletions
@@ -16,12 +16,10 @@
import AnalyticsEvents
/// Failure reasons as defined in https://docs.google.com/document/d/1es7cTCeJEXXfRCTRgZerAM2Wg5ZerHjvlpfTW-gsOfI.
@objc enum DecryptionFailureReason: Int {
case unspecified
case olmKeysNotSent
case olmIndexError
case unexpected
var errorName: AnalyticsEvent.Error.Name {
switch self {
@@ -31,8 +29,6 @@ import AnalyticsEvents
return .OlmKeysNotSentError
case .olmIndexError:
return .OlmIndexError
case .unexpected:
return .UnknownError
}
}
}
@@ -105,12 +105,9 @@ NSString *const kDecryptionFailureTrackerAnalyticsCategory = @"e2e.failure";
reason = DecryptionFailureReasonOlmIndexError;
break;
case MXDecryptingErrorEncryptionNotEnabledCode:
case MXDecryptingErrorUnableToDecryptCode:
reason = DecryptionFailureReasonUnexpected;
break;
default:
// All other error codes will be tracked as `OlmUnspecifiedError` and will include `context` containing
// the actual error code and localized description
reason = DecryptionFailureReasonUnspecified;
break;
}
@@ -21,6 +21,9 @@ extension __MXCallHangupReason {
switch self {
case .userHangup:
return .VoipUserHangup
case .userBusy:
// There is no dedicated analytics event for `userBusy` error
return .UnknownError
case .inviteTimeout:
return .VoipInviteTimeout
case .iceFailed:
@@ -32,6 +35,9 @@ extension __MXCallHangupReason {
case .unknownError:
return .UnknownError
default:
MXLog.failure("Unknown or unhandled hangup reason", context: [
"reason": rawValue
])
return .UnknownError
}
}
+1
View File
@@ -0,0 +1 @@
Analytics: Ensure E2EE never tracks UnknownError