From 0e7e1f9dd071207d56066319e137bea7ebacd187 Mon Sep 17 00:00:00 2001 From: marcinwasowicz Date: Fri, 10 Nov 2023 16:52:08 +0100 Subject: [PATCH] Call "flushState" after calling "contentHandler" in the NSE. Summary: This differential places a call to "flushState" after a call to "contentHandler" to handle the possibility that the NSE restarts notification processing before calling "contentHandler" Test Plan: Add ling with logging just after the line that calls "contentHandler". Build iOS app and sends some notifications ensure that logging line is called at least every 4 - 5 notifications. Reviewers: tomek, ashoat Reviewed By: ashoat Subscribers: wyilio Differential Revision: https://phab.comm.dev/D9822 --- native/ios/NotificationService/NotificationService.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/ios/NotificationService/NotificationService.mm b/native/ios/NotificationService/NotificationService.mm index 945f72b295..09d7b1b1bf 100644 --- a/native/ios/NotificationService/NotificationService.mm +++ b/native/ios/NotificationService/NotificationService.mm @@ -221,13 +221,13 @@ - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request return; } + [self callContentHandlerForKey:contentHandlerKey + withContent:publicUserContent]; + if (decryptionExecuted) { comm::NotificationsCryptoModule::flushState( std::move(statefulDecryptResultPtr), callingProcessName); } - - [self callContentHandlerForKey:contentHandlerKey - withContent:publicUserContent]; } - (void)serviceExtensionTimeWillExpire {