Send UTD occurences to Posthog (#2575)

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
Mauro
2024-03-15 00:42:44 +01:00
committed by GitHub
parent c68ec2c382
commit 7611123ae1
8 changed files with 55 additions and 12 deletions
@@ -139,6 +139,24 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
}
}
.store(in: &cancellables)
userSession.clientProxy.actionsPublisher
.receive(on: DispatchQueue.main)
.sink { action in
guard case let .receivedDecryptionError(info) = action else {
return
}
let timeToDecryptMs: Int
if let unsignedTimeToDecryptMs = info.timeToDecryptMs {
timeToDecryptMs = Int(unsignedTimeToDecryptMs)
} else {
timeToDecryptMs = -1
}
analytics.trackError(context: nil, domain: .E2EE, name: .OlmKeysNotSentError, timeToDecryptMillis: timeToDecryptMs)
}
.store(in: &cancellables)
}
func start() {