Page MenuHomePhabricator

D5234.diff
No OneTemporary

D5234.diff

diff --git a/native/ios/Comm/AppDelegate.mm b/native/ios/Comm/AppDelegate.mm
--- a/native/ios/Comm/AppDelegate.mm
+++ b/native/ios/Comm/AppDelegate.mm
@@ -15,6 +15,7 @@
#import <reacthermes/HermesExecutorFactory.h>
#import "CommCoreModule.h"
+#import "GlobalDBSingleton.h"
#import "GlobalNetworkSingleton.h"
#import "Logger.h"
#import "MessageOperationsUtilities.h"
@@ -168,7 +169,9 @@
// this callback may be called from inactive state so we need
// to initialize the database
[self attemptDatabaseInitialization];
- comm::ThreadOperations::updateSQLiteUnreadStatus(threadID, false);
+ comm::GlobalDBSingleton::instance.scheduleOrRun([threadID]() mutable {
+ comm::ThreadOperations::updateSQLiteUnreadStatus(threadID, false);
+ });
}
[[UNUserNotificationCenter currentNotificationCenter]
getDeliveredNotificationsWithCompletionHandler:^(
@@ -271,7 +274,9 @@
NSArray<NSString *> *messages = [temporaryStorage readAndClearMessages];
for (NSString *message in messages) {
std::string messageInfos = std::string([message UTF8String]);
- comm::MessageOperationsUtilities::storeMessageInfos(messageInfos);
+ comm::GlobalDBSingleton::instance.scheduleOrRun([messageInfos]() mutable {
+ comm::MessageOperationsUtilities::storeMessageInfos(messageInfos);
+ });
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 4:15 PM (19 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571521
Default Alt Text
D5234.diff (1 KB)

Event Timeline