Add script to extract and gather analytics event names.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 0cf9c01af2
commit f1807cd709

@ -263,7 +263,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
OWSProdError(@"app_delegate_error_failed_to_register_for_remote_notifications");
OWSProdError([OWSAnalyticsEvents appDelegateErrorFailedToRegisterForRemoteNotifications]);
#ifdef DEBUG
DDLogWarn(@"%@ We're in debug mode. Faking success for remote registration with a fake push identifier", self.tag);
[PushManager.sharedManager.pushNotificationFutureSource trySetResult:[[NSMutableData dataWithLength:32] copy]];

@ -261,10 +261,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)verifyChallengeAction:(nullable id)sender
{
[self startActivityIndicator];
OWSProdInfo(@"registration_registering_code");
OWSProdInfo([OWSAnalyticsEvents registrationRegisteringCode]);
[self.accountManager registerWithVerificationCode:[self validationCodeFromTextField]]
.then(^{
OWSProdInfo(@"registration_registering_submitted_code");
OWSProdInfo([OWSAnalyticsEvents registrationRegisteringSubmittedCode]);
DDLogInfo(@"%@ Successfully registered Signal account.", self.tag);
dispatch_async(dispatch_get_main_queue(), ^{
@ -280,7 +280,7 @@ NS_ASSUME_NONNULL_BEGIN
});
})
.catch(^(NSError *_Nonnull error) {
OWSProdInfo(@"registration_registration_failed");
OWSProdInfo([OWSAnalyticsEvents registrationRegistrationFailed]);
DDLogError(@"%@ error verifying challenge: %@", self.tag, error);
dispatch_async(dispatch_get_main_queue(), ^{
[self stopActivityIndicator];
@ -324,7 +324,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Send codes again
- (void)sendCodeViaSMSAction:(id)sender {
OWSProdInfo(@"registration_registering_requested_new_code_by_sms");
OWSProdInfo([OWSAnalyticsEvents registrationRegisteringRequestedNewCodeBySms]);
[self enableServerActions:NO];
@ -343,7 +343,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)sendCodeViaVoiceAction:(id)sender {
OWSProdInfo(@"registration_registering_requested_new_code_by_voice");
OWSProdInfo([OWSAnalyticsEvents registrationRegisteringRequestedNewCodeByVoice]);
[self enableServerActions:NO];
@ -374,7 +374,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)backButtonPressed:(id)sender {
OWSProdInfo(@"registration_verification_back");
OWSProdInfo([OWSAnalyticsEvents registrationVerificationBack]);
[self.navigationController popViewControllerAnimated:YES];
}

@ -54,8 +54,8 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
- (void)viewDidLoad {
[super viewDidLoad];
OWSProdInfo(@"registration_began");
OWSProdInfo([OWSAnalyticsEvents registrationBegan]);
}
- (void)createViews
@ -341,7 +341,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
__weak RegistrationViewController *weakSelf = self;
[TSAccountManager registerWithPhoneNumber:parsedPhoneNumber
success:^{
OWSProdInfo(@"registration_registered_phone_number");
OWSProdInfo([OWSAnalyticsEvents registrationRegisteredPhoneNumber]);
[weakSelf.spinnerView stopAnimating];

@ -35,7 +35,8 @@ static NSString *const OWS103EnableVideoCallingMigrationId = @"103";
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_enable_video_calling_request_failed");
OWSProdError([OWSAnalyticsEvents
errorEnableVideoCallingRequestFailed]);
}
DDLogError(@"%@ failed with error: %@", self.tag, error);
}];

@ -151,7 +151,7 @@
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_update_attributes_request_failed");
OWSProdError([OWSAnalyticsEvents errorUpdateAttributesRequestFailed]);
}
success = NO;
DDLogError(@"Updating attributess failed with error: %@", error.description);

@ -160,7 +160,7 @@ NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName
remainingRetries:remainingRetries - 1];
} else {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"accounts_error_register_push_tokens_failed");
OWSProdError([OWSAnalyticsEvents accountsErrorRegisterPushTokensFailed]);
}
failureHandler(error);
}
@ -197,7 +197,7 @@ NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"accounts_error_verification_code_request_failed");
OWSProdError([OWSAnalyticsEvents accountsErrorVerificationCodeRequestFailed]);
}
DDLogError(@"%@ Failed to request verification code request with error:%@", self.tag, error);
failureBlock(error);
@ -270,7 +270,7 @@ NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"accounts_error_verify_account_request_failed");
OWSProdError([OWSAnalyticsEvents accountsErrorVerifyAccountRequestFailed]);
}
DDLogWarn(@"%@ Error verifying code: %@", self.tag, error.debugDescription);
switch (error.code) {
@ -326,7 +326,7 @@ NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"accounts_error_unregister_account_request_failed");
OWSProdError([OWSAnalyticsEvents accountsErrorUnregisterAccountRequestFailed]);
}
DDLogError(@"%@ Failed to unregister with error: %@", self.tag, error);
failureBlock(error);

@ -183,9 +183,9 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
if (modeCopy == RefreshPreKeysMode_SignedAndOneTime) {
OWSProdError(@"error_prekeys_update_failed_signed_and_onetime");
OWSProdError([OWSAnalyticsEvents errorPrekeysUpdateFailedSignedAndOnetime]);
} else {
OWSProdError(@"error_prekeys_update_failed_just_signed");
OWSProdError([OWSAnalyticsEvents errorPrekeysUpdateFailedJustSigned]);
}
}
@ -305,7 +305,7 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_prekeys_current_signed_prekey_request_failed");
OWSProdError([OWSAnalyticsEvents errorPrekeysCurrentSignedPrekeyRequestFailed]);
}
DDLogWarn(@"%@ Could not retrieve current signed key from the service.", self.tag);
@ -316,7 +316,7 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_prekeys_available_prekeys_request_failed");
OWSProdError([OWSAnalyticsEvents errorPrekeysAvailablePrekeysRequestFailed]);
}
DDLogError(@"%@ Failed to retrieve the number of available prekeys.", self.tag);
@ -402,9 +402,9 @@ static const NSTimeInterval kSignedPreKeyUpdateFailureMaxFailureDuration = 10 *
}
if (signedPrekey.wasAcceptedByService) {
OWSProdInfo(@"prekeys_deleted_old_accepted_signed_prekey");
OWSProdInfo([OWSAnalyticsEvents prekeysDeletedOldAcceptedSignedPrekey]);
} else {
OWSProdInfo(@"prekeys_deleted_old_unaccepted_signed_prekey");
OWSProdInfo([OWSAnalyticsEvents prekeysDeletedOldUnacceptedSignedPrekey]);
}
oldSignedPreKeyCount--;

@ -206,7 +206,7 @@ NS_ASSUME_NONNULL_BEGIN
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"contacts_error_contacts_intersection_failed");
OWSProdError([OWSAnalyticsEvents contactsErrorContactsIntersectionFailed]);
}
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;

@ -187,7 +187,7 @@ static const CGFloat kAttachmentDownloadProgressTheta = 0.001f;
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_attachment_request_failed");
OWSProdError([OWSAnalyticsEvents errorAttachmentRequestFailed]);
}
DDLogError(@"Failed retrieval of attachment with error: %@", error);
if (attachment.serverId < 100) {

@ -336,7 +336,7 @@ NSString *const OWSMessageProcessingJobFinderExtensionGroup = @"OWSMessageProces
// Drop any too-large messages on the floor. Well behaving clients should never send them.
NSUInteger kMaxEnvelopeByteCount = 250 * 1024;
if (envelope.serializedSize > kMaxEnvelopeByteCount) {
OWSProdError(@"message_receiver_error_oversize_message");
OWSProdError([OWSAnalyticsEvents messageReceiverErrorOversizeMessage]);
return;
}
@ -344,7 +344,7 @@ NSString *const OWSMessageProcessingJobFinderExtensionGroup = @"OWSMessageProces
// This likely indicates a misbehaving sending client.
NSUInteger kLargeEnvelopeWarningByteCount = 25 * 1024;
if (envelope.serializedSize > kLargeEnvelopeWarningByteCount) {
OWSProdError(@"message_receiver_error_large_message");
OWSProdError([OWSAnalyticsEvents messageReceiverErrorLargeMessage]);
}
[self.processingQueue enqueueEnvelopeForProcessing:envelope];

@ -186,7 +186,7 @@ NSUInteger const OWSSendMessageOperationMaxRetries = 4;
_successHandler = ^{
typeof(self) strongSelf = weakSelf;
if (!strongSelf) {
OWSProdCFail(@"message_sender_error_send_operation_did_not_complete");
OWSProdCFail([OWSAnalyticsEvents messageSenderErrorSendOperationDidNotComplete]);
return;
}
@ -200,7 +200,7 @@ NSUInteger const OWSSendMessageOperationMaxRetries = 4;
_failureHandler = ^(NSError *_Nonnull error) {
typeof(self) strongSelf = weakSelf;
if (!strongSelf) {
OWSProdCFail(@"message_sender_error_send_operation_did_not_complete");
OWSProdCFail([OWSAnalyticsEvents messageSenderErrorSendOperationDidNotComplete]);
return;
}
@ -474,7 +474,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
[TSAttachmentStream fetchObjectWithUniqueID:message.attachmentIds.firstObject];
if (!attachmentStream) {
OWSProdError(@"message_sender_error_could_not_load_attachment");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotLoadAttachment]);
NSError *error = OWSErrorMakeFailedToSendOutgoingMessageError();
// Not finding local attachment is a terminal failure.
[error setIsRetryable:NO];
@ -539,7 +539,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
NSError *error;
[attachmentStream writeData:dataCopy error:&error];
if (error) {
OWSProdError(@"message_sender_error_could_not_write_attachment");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotWriteAttachment]);
return failureHandler(error);
}
@ -575,7 +575,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
if (recipients.count == 0 && !*error) {
// error should be set in contactsUpater, but just in case.
OWSProdError(@"message_sender_error_could_not_find_contacts_1");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotFindContacts1]);
*error = OWSErrorMakeFailedToSendOutgoingMessageError();
}
@ -598,7 +598,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
if (recipients.count == 0) {
if (!error) {
OWSProdError(@"message_sender_error_could_not_find_contacts_2");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotFindContacts2]);
error = OWSErrorMakeFailedToSendOutgoingMessageError();
}
// If no recipients were found, there's no reason to retry. It will just fail again.
@ -652,7 +652,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
[self unregisteredRecipient:recipient message:message thread:thread];
}
OWSProdError(@"message_sender_error_could_not_find_contacts_3");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotFindContacts3]);
// No need to repeat trying to find a failure. Apart from repeatedly failing, it would also cause us
// to print redundant error messages.
[error setIsRetryable:NO];
@ -834,7 +834,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
AssertIsOnSendingQueue();
if ([TSPreKeyManager isAppLockedDueToPreKeyUpdateFailures]) {
OWSProdError(@"message_send_error_failed_due_to_prekey_update_failures");
OWSProdError([OWSAnalyticsEvents messageSendErrorFailedDueToPrekeyUpdateFailures]);
// Retry prekey update every time user tries to send a message while app
// is disabled due to prekey update failures.
@ -856,7 +856,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
if (remainingAttempts <= 0) {
// We should always fail with a specific error.
OWSProdFail(@"message_sender_error_generic_send_failure");
OWSProdFail([OWSAnalyticsEvents messageSenderErrorGenericSendFailure]);
NSError *error = OWSErrorMakeFailedToSendOutgoingMessageError();
[error setIsRetryable:YES];
@ -874,7 +874,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
// We expect it to happen whenever Bob reinstalls, and Alice messages Bob before
// she can pull down his latest identity.
// If it's happening a lot, we should rethink our profile fetching strategy.
OWSProdInfo(@"message_send_error_failed_due_to_untrusted_key");
OWSProdInfo([OWSAnalyticsEvents messageSendErrorFailedDueToUntrustedKey]);
NSString *localizedErrorDescriptionFormat
= NSLocalizedString(@"FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY",
@ -893,7 +893,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
PreKeyBundle *newKeyBundle = exception.userInfo[TSInvalidPreKeyBundleKey];
if (![newKeyBundle isKindOfClass:[PreKeyBundle class]]) {
OWSProdFail(@"message_sender_error_unexpected_key_bundle");
OWSProdFail([OWSAnalyticsEvents messageSenderErrorUnexpectedKeyBundle]);
failureHandler(error);
return;
}
@ -901,14 +901,14 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
NSData *newIdentityKeyWithVersion = newKeyBundle.identityKey;
if (![newIdentityKeyWithVersion isKindOfClass:[NSData class]]) {
OWSProdFail(@"message_sender_error_invalid_identity_key_type");
OWSProdFail([OWSAnalyticsEvents messageSenderErrorInvalidIdentityKeyType]);
failureHandler(error);
return;
}
// TODO migrate to storing the full 33 byte representation of the identity key.
if (newIdentityKeyWithVersion.length != kIdentityKeyLength) {
OWSProdFail(@"message_sender_error_invalid_identity_key_length");
OWSProdFail([OWSAnalyticsEvents messageSenderErrorInvalidIdentityKeyLength]);
failureHandler(error);
return;
}
@ -1013,7 +1013,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
NSDictionary *serializedResponse =
[NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error];
if (error) {
OWSProdError(@"message_sender_error_could_not_parse_mismatched_devices_json");
OWSProdError([OWSAnalyticsEvents messageSenderErrorCouldNotParseMismatchedDevicesJson]);
[error setIsRetryable:YES];
return failureHandler(error);
}
@ -1053,7 +1053,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
dispatch_async([OWSDispatch sessionStoreQueue], ^{
if (extraDevices.count < 1 && missingDevices.count < 1) {
OWSProdFail(@"message_sender_error_no_missing_or_extra_devices");
OWSProdFail([OWSAnalyticsEvents messageSenderErrorNoMissingOrExtraDevices]);
}
if (extraDevices && extraDevices.count > 0) {
@ -1217,7 +1217,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"message_sender_error_recipient_prekey_request_failed");
OWSProdError([OWSAnalyticsEvents messageSenderErrorRecipientPrekeyRequestFailed]);
}
DDLogError(@"Server replied to PreKeyBundle request with error: %@", error);
NSHTTPURLResponse *response = (NSHTTPURLResponse *)task.response;
@ -1290,7 +1290,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
NSDictionary *jsonDict = [MTLJSONAdapter JSONDictionaryFromModel:messageParams error:&error];
if (error) {
OWSProdError(@"message_send_error_could_not_serialize_message_json");
OWSProdError([OWSAnalyticsEvents messageSendErrorCouldNotSerializeMessageJson]);
return nil;
}

@ -158,19 +158,19 @@ NS_ASSUME_NONNULL_BEGIN
return @"DeliveryReceipt";
case OWSSignalServiceProtosEnvelopeTypeUnknown:
// Shouldn't happen
OWSProdFail(@"message_manager_error_envelope_type_unknown");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorEnvelopeTypeUnknown]);
return @"Unknown";
case OWSSignalServiceProtosEnvelopeTypeCiphertext:
return @"SignalEncryptedMessage";
case OWSSignalServiceProtosEnvelopeTypeKeyExchange:
// Unsupported
OWSProdFail(@"message_manager_error_envelope_type_key_exchange");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorEnvelopeTypeKeyExchange]);
return @"KeyExchange";
case OWSSignalServiceProtosEnvelopeTypePrekeyBundle:
return @"PreKeyEncryptedMessage";
default:
// Shouldn't happen
OWSProdFail(@"message_manager_error_envelope_type_other");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorEnvelopeTypeOther]);
return @"Other";
}
}
@ -312,7 +312,8 @@ NS_ASSUME_NONNULL_BEGIN
envelope.source,
(unsigned int)envelope.sourceDevice,
error);
OWSProdError(@"message_manager_error_could_not_handle_secure_message");
OWSProdError(
[OWSAnalyticsEvents messageManagerErrorCouldNotHandleSecureMessage]);
}
completion();
}];
@ -330,7 +331,8 @@ NS_ASSUME_NONNULL_BEGIN
envelope.source,
(unsigned int)envelope.sourceDevice,
error);
OWSProdError(@"message_manager_error_could_not_handle_prekey_bundle");
OWSProdError(
[OWSAnalyticsEvents messageManagerErrorCouldNotHandlePrekeyBundle]);
}
completion();
}];
@ -355,7 +357,7 @@ NS_ASSUME_NONNULL_BEGIN
}
} @catch (NSException *exception) {
DDLogError(@"Received an incorrectly formatted protocol buffer: %@", exception.debugDescription);
OWSProdFail(@"message_manager_error_invalid_protocol_message");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorInvalidProtocolMessage]);
}
completion();
@ -387,7 +389,7 @@ NS_ASSUME_NONNULL_BEGIN
NSData *encryptedData
= messageEnvelope.hasContent ? messageEnvelope.content : messageEnvelope.legacyMessage;
if (!encryptedData) {
OWSProdFail(@"message_manager_error_message_envelope_has_no_content");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorMessageEnvelopeHasNoContent]);
completion(nil);
return;
}
@ -436,7 +438,7 @@ NS_ASSUME_NONNULL_BEGIN
// DEPRECATED - Remove after all clients have been upgraded.
NSData *encryptedData = preKeyEnvelope.hasContent ? preKeyEnvelope.content : preKeyEnvelope.legacyMessage;
if (!encryptedData) {
OWSProdFail(@"message_manager_error_prekey_bundle_envelope_has_no_content");
OWSProdFail([OWSAnalyticsEvents messageManagerErrorPrekeyBundleEnvelopeHasNoContent]);
completion(nil);
return;
}

@ -51,7 +51,7 @@ NSString *const OWSDeviceProvisioningCodeServiceProvisioningCodeKey = @"verifica
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_provisioning_code_request_failed");
OWSProdError([OWSAnalyticsEvents errorProvisioningCodeRequestFailed]);
}
DDLogVerbose(@"ProvisioningCode request failed with error: %@", error);
failureCallback(error);

@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_provisioning_request_failed");
OWSProdError([OWSAnalyticsEvents errorProvisioningRequestFailed]);
}
DDLogVerbose(@"Provisioning request failed with error: %@", error);
failureCallback(error);

@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_get_devices_failed");
OWSProdError([OWSAnalyticsEvents errorGetDevicesFailed]);
}
DDLogVerbose(@"Get devices request failed with error: %@", error);
failureCallback(error);
@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {
OWSProdError(@"error_unlink_device_failed");
OWSProdError([OWSAnalyticsEvents errorUnlinkDeviceFailed]);
}
DDLogVerbose(@"Get devices request failed with error: %@", error);
failureCallback(error);

@ -86,7 +86,7 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
- (nullable Class)unarchiver:(NSKeyedUnarchiver *)unarchiver cannotDecodeObjectOfClassName:(NSString *)name originalClasses:(NSArray<NSString *> *)classNames
{
OWSProdError(@"storage_error_could_not_decode_class");
OWSProdError([OWSAnalyticsEvents storageErrorCouldNotDecodeClass]);
return [OWSUnknownObject class];
}
@ -117,14 +117,14 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
//
// The best we can try to do is to discard the current database
// and behave like a clean install.
OWSProdCritical(@"storage_error_could_not_load_database");
OWSProdCritical([OWSAnalyticsEvents storageErrorCouldNotLoadDatabase]);
// Try to reset app by deleting database.
// Disabled resetting storage until we have better data on why this happens.
// [self resetSignalStorage];
if (![self tryToLoadDatabase]) {
OWSProdCritical(@"storage_error_could_not_load_database_second_attempt");
OWSProdCritical([OWSAnalyticsEvents storageErrorCouldNotLoadDatabaseSecondAttempt]);
// Sleep to give analytics events time to be delivered.
[NSThread sleepForTimeInterval:15.0f];
@ -183,7 +183,7 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
return [unarchiver decodeObjectForKey:@"root"];
} @catch (NSException *exception) {
// Sync log in case we bail.
OWSProdError(@"storage_error_deserialization");
OWSProdError([OWSAnalyticsEvents storageErrorDeserialization]);
@throw exception;
}
};
@ -253,7 +253,7 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
BOOL success = [ressourceURL setResourceValues:resourcesAttrs error:&error];
if (error || !success) {
OWSProdCritical(@"storage_error_file_protection");
OWSProdCritical([OWSAnalyticsEvents storageErrorFileProtection]);
}
}
@ -353,7 +353,7 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
BOOL shouldHavePassword = [NSFileManager.defaultManager fileExistsAtPath:[self dbPath]];
if (shouldHavePassword) {
OWSProdCritical(@"storage_error_could_not_load_database_second_attempt");
OWSProdCritical([OWSAnalyticsEvents storageErrorCouldNotLoadDatabaseSecondAttempt]);
}
// Try to reset app by deleting database.
@ -372,7 +372,7 @@ static NSString *keychainDBPassAccount = @"TSDatabasePass";
NSError *keySetError;
[SAMKeychain setPassword:newDBPassword forService:keychainService account:keychainDBPassAccount error:&keySetError];
if (keySetError) {
OWSProdCritical(@"storage_error_could_not_store_database_password");
OWSProdCritical([OWSAnalyticsEvents storageErrorCouldNotStoreDatabasePassword]);
[self deletePasswordFromKeychain];

@ -411,7 +411,7 @@ NSString *NSStringForOWSAnalyticsSeverity(OWSAnalyticsSeverity severity)
- (void)appLaunchDidBegin
{
OWSProdInfo(@"app_launch");
OWSProdInfo([OWSAnalyticsEvents appLaunch]);
}
#pragma mark - Logging

@ -22,28 +22,6 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)appLaunch;
+ (NSString *)appLaunchComplete;
+ (NSString *)callServiceCallAlreadySet;
+ (NSString *)callServiceCallIdMismatch;
+ (NSString *)callServiceCallMismatch;
+ (NSString *)callServiceCallMissing;
+ (NSString *)callServiceCallUnexpectedlyIdle;
+ (NSString *)callServiceCouldNotCreatePeerConnectionClientPromise;
+ (NSString *)callServiceCouldNotCreateReadyToSendIceUpdatesPromise;
+ (NSString *)callServiceMissingFulfillReadyToSendIceUpdatesPromise;
+ (NSString *)callServicePeerConnectionAlreadySet;
+ (NSString *)callServicePeerConnectionMissing;
+ (NSString *)contactsErrorContactsIntersectionFailed;
+ (NSString *)errorAttachmentRequestFailed;
@ -82,10 +60,12 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)messageManagerErrorMessageEnvelopeHasNoContent;
+ (NSString *)messageManagerErrorOversizeMessage;
+ (NSString *)messageManagerErrorPrekeyBundleEnvelopeHasNoContent;
+ (NSString *)messageReceiverErrorLargeMessage;
+ (NSString *)messageReceiverErrorOversizeMessage;
+ (NSString *)messageSendErrorCouldNotSerializeMessageJson;
+ (NSString *)messageSendErrorFailedDueToPrekeyUpdateFailures;
@ -118,7 +98,25 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)messageSenderErrorUnexpectedKeyBundle;
+ (NSString *)prekeysDeletedOldSignedPrekey;
+ (NSString *)prekeysDeletedOldAcceptedSignedPrekey;
+ (NSString *)prekeysDeletedOldUnacceptedSignedPrekey;
+ (NSString *)registrationBegan;
+ (NSString *)registrationRegisteredPhoneNumber;
+ (NSString *)registrationRegisteringCode;
+ (NSString *)registrationRegisteringRequestedNewCodeBySms;
+ (NSString *)registrationRegisteringRequestedNewCodeByVoice;
+ (NSString *)registrationRegisteringSubmittedCode;
+ (NSString *)registrationRegistrationFailed;
+ (NSString *)registrationVerificationBack;
+ (NSString *)storageErrorCouldNotDecodeClass;

@ -200,6 +200,16 @@ NS_ASSUME_NONNULL_BEGIN
return @"message_manager_error_prekey_bundle_envelope_has_no_content";
}
+ (NSString *)messageReceiverErrorLargeMessage
{
return @"message_receiver_error_large_message";
}
+ (NSString *)messageReceiverErrorOversizeMessage
{
return @"message_receiver_error_oversize_message";
}
+ (NSString *)messageSendErrorCouldNotSerializeMessageJson
{
return @"message_send_error_could_not_serialize_message_json";
@ -280,11 +290,61 @@ NS_ASSUME_NONNULL_BEGIN
return @"message_sender_error_unexpected_key_bundle";
}
+ (NSString *)prekeysDeletedOldAcceptedSignedPrekey
{
return @"prekeys_deleted_old_accepted_signed_prekey";
}
+ (NSString *)prekeysDeletedOldSignedPrekey
{
return @"prekeys_deleted_old_signed_prekey";
}
+ (NSString *)prekeysDeletedOldUnacceptedSignedPrekey
{
return @"prekeys_deleted_old_unaccepted_signed_prekey";
}
+ (NSString *)registrationBegan
{
return @"registration_began";
}
+ (NSString *)registrationRegisteredPhoneNumber
{
return @"registration_registered_phone_number";
}
+ (NSString *)registrationRegisteringCode
{
return @"registration_registering_code";
}
+ (NSString *)registrationRegisteringRequestedNewCodeBySms
{
return @"registration_registering_requested_new_code_by_sms";
}
+ (NSString *)registrationRegisteringRequestedNewCodeByVoice
{
return @"registration_registering_requested_new_code_by_voice";
}
+ (NSString *)registrationRegisteringSubmittedCode
{
return @"registration_registering_submitted_code";
}
+ (NSString *)registrationRegistrationFailed
{
return @"registration_registration_failed";
}
+ (NSString *)registrationVerificationBack
{
return @"registration_verification_back";
}
+ (NSString *)storageErrorCouldNotDecodeClass
{
return @"storage_error_could_not_decode_class";

Loading…
Cancel
Save