Give Posthog a correct total count of decryption failures (#7475)

This commit is contained in:
Faye Duxovni 2022-01-07 09:15:33 -05:00 committed by GitHub
parent 9fd933a0b6
commit 59ef2704f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1632,11 +1632,13 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
const dft = new DecryptionFailureTracker((total, errorCode) => { const dft = new DecryptionFailureTracker((total, errorCode) => {
Analytics.trackEvent('E2E', 'Decryption failure', errorCode, String(total)); Analytics.trackEvent('E2E', 'Decryption failure', errorCode, String(total));
CountlyAnalytics.instance.track("decryption_failure", { errorCode }, null, { sum: total }); CountlyAnalytics.instance.track("decryption_failure", { errorCode }, null, { sum: total });
for (let i = 0; i < total; i++) {
PosthogAnalytics.instance.trackEvent<ErrorEvent>({ PosthogAnalytics.instance.trackEvent<ErrorEvent>({
eventName: "Error", eventName: "Error",
domain: "E2EE", domain: "E2EE",
name: errorCode, name: errorCode,
}); });
}
}, (errorCode) => { }, (errorCode) => {
// Map JS-SDK error codes to tracker codes for aggregation // Map JS-SDK error codes to tracker codes for aggregation
switch (errorCode) { switch (errorCode) {