Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3350011
D5234.id17411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5234.id17411.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 8:16 PM (20 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571521
Default Alt Text
D5234.id17411.diff (1 KB)
Attached To
Mode
D5234: Use GlobalDBSingleton when touching database from the native iOS code.
Attached
Detach File
Event Timeline
Log In to Comment