Page MenuHomePhabricator

D11721.diff
No OneTemporary

D11721.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
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)

Event Timeline