Telemetry | Add more properties to posthog utd errors

This commit is contained in:
Valere
2024-04-05 09:53:07 +02:00
parent 047be10692
commit e216c1bbf5
4 changed files with 102 additions and 15 deletions

View File

@@ -103,6 +103,17 @@ class DecryptionFailureTracker: NSObject {
failure.eventLocalAgeMillis = Int(exactly: eventRelativeAgeMillis)
failure.trustOwnIdentityAtTimeOfFailure = isSessionVerified
let myDomain = userId.components(separatedBy: ":")[1]
failure.isMatrixOrg = myDomain == "matrix.org"
if MXTools.isMatrixUserIdentifier(event.sender) {
let senderDomain = event.sender.components(separatedBy: ":")[1]
failure.isFederated = senderDomain != myDomain
}
/// XXX for future work, as for now only the event formatter reports UTDs. That means that it's only UTD ~visible to users
failure.wasVisibleToUser = true
reportedFailures[failedEventId] = failure