Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3340910
D11721.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.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
Fri, Nov 22, 10:13 PM (17 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2565832
Default Alt Text
D11721.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