FIX: verifiying unregistered user prints "no longer registered" error on

every launch

// FREEBIE
This commit is contained in:
Michael Kirk 2017-07-01 09:53:45 -07:00
parent 1fc5f77286
commit deff1fa4e7

View file

@ -5,6 +5,7 @@
#import "OWSIdentityManager.h"
#import "NSDate+millisecondTimeStamp.h"
#import "NotificationsProtocol.h"
#import "OWSError.h"
#import "OWSMessageSender.h"
#import "OWSOutgoingNullMessage.h"
#import "OWSRecipientIdentity.h"
@ -537,6 +538,13 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
}
failure:^(NSError *_Nonnull error) {
DDLogError(@"%@ Failed to send verification state NullMessage with error: %@", self.tag, error);
if (error.code == OWSErrorCodeNoSuchSignalRecipient) {
DDLogInfo(@"%@ Removing retries for syncing verification state, since user is no longer registered: %@",
self.tag,
message.verificationForRecipientId);
// Otherwise this will fail forever.
[self clearSyncMessageForRecipientId:message.verificationForRecipientId];
}
}];
}