Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3156466
D11721.id39614.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
D11721.id39614.diff
View Options
diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -442,6 +442,7 @@
GlobalDBSingleton::instance.scheduleOrRunCancellable(
[=, &persistencePromise]() {
try {
+ DatabaseManager::getQueryExecutor().beginTransaction();
if (persistContentModule) {
DatabaseManager::getQueryExecutor().storeOlmPersistData(
DatabaseManager::getQueryExecutor().getContentAccountID(),
@@ -452,8 +453,10 @@
DatabaseManager::getQueryExecutor().getNotifsAccountID(),
newNotifsPersist);
}
+ DatabaseManager::getQueryExecutor().commitTransaction();
persistencePromise.set_value();
} catch (std::system_error &e) {
+ DatabaseManager::getQueryExecutor().rollbackTransaction();
persistencePromise.set_exception(std::make_exception_ptr(e));
}
});
diff --git a/web/shared-worker/worker/worker-crypto.js b/web/shared-worker/worker/worker-crypto.js
--- a/web/shared-worker/worker/worker-crypto.js
+++ b/web/shared-worker/worker/worker-crypto.js
@@ -119,6 +119,7 @@
};
try {
+ sqliteQueryExecutor.beginTransaction();
sqliteQueryExecutor.storeOlmPersistAccount(
sqliteQueryExecutor.getContentAccountID(),
JSON.stringify(pickledContentAccount),
@@ -130,7 +131,9 @@
sqliteQueryExecutor.getNotifsAccountID(),
JSON.stringify(pickledNotificationAccount),
);
+ sqliteQueryExecutor.commitTransaction();
} catch (err) {
+ sqliteQueryExecutor.rollbackTransaction();
throw new Error(getProcessingStoreOpsExceptionMessage(err, dbModule));
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 3:41 PM (20 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2431319
Default Alt Text
D11721.id39614.diff (1 KB)
Attached To
Mode
D11721: [native/web] add SQL transaction to persisting crypto module
Attached
Detach File
Event Timeline
Log In to Comment