diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 1156d0376..f6e331c11 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -194,6 +194,7 @@ typedef enum : NSUInteger { @property (nonatomic) BOOL isViewCompletelyAppeared; @property (nonatomic) BOOL isViewVisible; +@property (nonatomic) BOOL isViewDisappearing; @property (nonatomic) BOOL shouldAnimateKeyboardChanges; @property (nonatomic) BOOL viewHasEverAppeared; @property (nonatomic) BOOL hasUnreadMessages; @@ -737,6 +738,7 @@ typedef enum : NSUInteger { [self hideInputIfNeeded]; self.isViewVisible = YES; + self.isViewDisappearing = NO; // We should have already requested contact access at this point, so this should be a no-op // unless it ever becomes possible to load this VC without going via the HomeViewController. @@ -1262,17 +1264,20 @@ typedef enum : NSUInteger { // until `viewDidDisappear`. - (void)viewWillDisappear:(BOOL)animated { - OWSLogDebug(@"viewWillDisappear"); + OWSLogDebug(@""); [super viewWillDisappear:animated]; self.isViewCompletelyAppeared = NO; + self.isViewDisappearing = YES; [self dismissMenuActions]; } - (void)viewDidDisappear:(BOOL)animated { + OWSLogDebug(@""); + [super viewDidDisappear:animated]; self.userHasScrolled = NO; self.isViewVisible = NO; @@ -3828,6 +3833,15 @@ typedef enum : NSUInteger { { OWSAssertIsOnMainThread(); + if (self.isViewDisappearing) { + // To avoid unnecessary animations, ignore keyboard notifications + // while the view is disappearing or has disappeared. + // + // This is safe; we'll always get more keyboard notifications when + // the view will re-appear. + return; + } + NSDictionary *userInfo = [notification userInfo]; NSValue *_Nullable keyboardBeginFrameValue = userInfo[UIKeyboardFrameBeginUserInfoKey]; diff --git a/SignalMessaging/profiles/ProfileFetcherJob.swift b/SignalMessaging/profiles/ProfileFetcherJob.swift index 176729b02..e1608b670 100644 --- a/SignalMessaging/profiles/ProfileFetcherJob.swift +++ b/SignalMessaging/profiles/ProfileFetcherJob.swift @@ -115,7 +115,8 @@ public class ProfileFetcherJob: NSObject { }.catch(on: DispatchQueue.global()) { error in switch error { case ProfileFetcherJobError.throttled(let lastTimeInterval): - Logger.info("skipping updateProfile: \(recipientId), lastTimeInterval: \(lastTimeInterval)") + // skipping + break case let error as SignalServiceProfile.ValidationError: Logger.warn("skipping updateProfile retry. Invalid profile for: \(recipientId) error: \(error)") default: