From 59ef2704f04216e9fe9575cbbf776bce55ffa7fa Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Fri, 7 Jan 2022 09:15:33 -0500 Subject: [PATCH] Give Posthog a correct total count of decryption failures (#7475) --- src/components/structures/MatrixChat.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 0f20e940bd..8b7ddaf218 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1632,11 +1632,13 @@ export default class MatrixChat extends React.PureComponent { const dft = new DecryptionFailureTracker((total, errorCode) => { Analytics.trackEvent('E2E', 'Decryption failure', errorCode, String(total)); CountlyAnalytics.instance.track("decryption_failure", { errorCode }, null, { sum: total }); - PosthogAnalytics.instance.trackEvent({ - eventName: "Error", - domain: "E2EE", - name: errorCode, - }); + for (let i = 0; i < total; i++) { + PosthogAnalytics.instance.trackEvent({ + eventName: "Error", + domain: "E2EE", + name: errorCode, + }); + } }, (errorCode) => { // Map JS-SDK error codes to tracker codes for aggregation switch (errorCode) {