Page MenuHomePhabricator

D11721.id39614.diff
No OneTemporary

D11721.id39614.diff

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

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)

Event Timeline