MESSENGER-4535 matomo e2ee error tracking

This commit is contained in:
Frank Rotermund
2023-04-12 16:13:25 +02:00
parent 2698a2d960
commit 46477d7023
6 changed files with 135 additions and 10 deletions

View File

@@ -116,7 +116,8 @@ NSString *const kDecryptionFailureTrackerAnalyticsCategory = @"e2e.failure";
NSString *context = [NSString stringWithFormat:@"code: %ld, description: %@", event.decryptionError.code, event.decryptionError.localizedDescription];
reportedFailures[event.eventId] = [[DecryptionFailure alloc] initWithFailedEventId:failedEventId
reason:reason
context:context];
context:context
errorCode:event.decryptionError.code];
}
- (void)dispatch
@@ -157,16 +158,18 @@ NSString *const kDecryptionFailureTrackerAnalyticsCategory = @"e2e.failure";
NSMutableDictionary<NSNumber*, NSNumber*> *failuresCounts = [NSMutableDictionary dictionary];
for (DecryptionFailure *failure in failuresToTrack)
{
failuresCounts[@(failure.reason)] = @(failuresCounts[@(failure.reason)].unsignedIntegerValue + 1);
//[self.delegate trackE2EEError:failure.reason context:failure.context];
if ( failure.reason == DecryptionFailureReasonUnspecified) {
[BWIAnalytics.sharedTracker trackE2EEError:failure.errorCode context:failure.context];
} else {
failuresCounts[@(failure.reason)] = @(failuresCounts[@(failure.reason)].unsignedIntegerValue + 1);
}
}
MXLogDebug(@"[DecryptionFailureTracker] trackFailures: %@", failuresCounts);
for (NSNumber *reason in failuresCounts)
{
// FRANK181
//[self.delegate trackE2EEError:reason.integerValue count:failuresCounts[reason].integerValue];
[BWIAnalytics.sharedTracker trackE2EEErrors:reason.integerValue count:failuresCounts[reason].integerValue];
}
}
}