Page MenuHomePhabricator

D11923.diff
No OneTemporary

D11923.diff

diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.h b/native/cpp/CommonCpp/NativeModules/CommCoreModule.h
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.h
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.h
@@ -57,48 +57,17 @@
virtual jsi::Value getClientDBStore(jsi::Runtime &rt) override;
virtual jsi::Value removeAllDrafts(jsi::Runtime &rt) override;
virtual jsi::Array getAllMessagesSync(jsi::Runtime &rt) override;
- virtual jsi::Value
- processDraftStoreOperations(jsi::Runtime &rt, jsi::Array operations) override;
- virtual jsi::Value processReportStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
virtual void processReportStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) override;
- virtual jsi::Value processMessageStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
virtual void processMessageStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) override;
virtual jsi::Array getAllThreadsSync(jsi::Runtime &rt) override;
- virtual jsi::Value processThreadStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
virtual void processThreadStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) override;
virtual jsi::Value
- processUserStoreOperations(jsi::Runtime &rt, jsi::Array operations) override;
- virtual jsi::Value processKeyserverStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value processCommunityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value processIntegrityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value processSyncedMetadataStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value processAuxUserStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value processThreadActivityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) override;
- virtual jsi::Value
processDBStoreOperations(jsi::Runtime &rt, jsi::Object operations) override;
template <typename T>
void appendDBStoreOps(
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
@@ -306,18 +306,6 @@
return jsiMessages;
}
-jsi::Value CommCoreModule::processDraftStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->draftStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processMessageStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->messageStore.processStoreOperations(rt, std::move(operations));
-}
-
void CommCoreModule::processMessageStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) {
@@ -339,74 +327,18 @@
return jsiThreads;
}
-jsi::Value CommCoreModule::processThreadStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->threadStore.processStoreOperations(rt, std::move(operations));
-}
-
void CommCoreModule::processThreadStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) {
this->threadStore.processStoreOperationsSync(rt, std::move(operations));
}
-jsi::Value CommCoreModule::processReportStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->reportStore.processStoreOperations(rt, std::move(operations));
-}
-
void CommCoreModule::processReportStoreOperationsSync(
jsi::Runtime &rt,
jsi::Array operations) {
this->reportStore.processStoreOperationsSync(rt, std::move(operations));
}
-jsi::Value CommCoreModule::processUserStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->userStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processKeyserverStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->keyserverStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processCommunityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->communityStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processIntegrityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->integrityStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processSyncedMetadataStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->syncedMetadataStore.processStoreOperations(
- rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processAuxUserStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->auxUserStore.processStoreOperations(rt, std::move(operations));
-}
-
-jsi::Value CommCoreModule::processThreadActivityStoreOperations(
- jsi::Runtime &rt,
- jsi::Array operations) {
- return this->threadActivityStore.processStoreOperations(
- rt, std::move(operations));
-}
-
template <typename T>
void CommCoreModule::appendDBStoreOps(
jsi::Runtime &rt,
diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/BaseDataStore.h b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/BaseDataStore.h
--- a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/BaseDataStore.h
+++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/BaseDataStore.h
@@ -34,56 +34,6 @@
jsi::Runtime &rt,
std::shared_ptr<std::vector<Entity>> dataVectorPtr) const = 0;
- jsi::Value processStoreOperations(jsi::Runtime &rt, jsi::Array &&operations) {
- std::string createOperationsError;
- std::shared_ptr<std::vector<std::unique_ptr<Operation>>> storeOpsPtr;
-
- try {
- auto storeOps = createOperations(rt, operations);
- storeOpsPtr = std::make_shared<std::vector<std::unique_ptr<Operation>>>(
- std::move(storeOps));
- } catch (std::runtime_error &e) {
- createOperationsError = e.what();
- }
-
- return facebook::react::createPromiseAsJSIValue(
- rt,
- [=](jsi::Runtime &innerRt,
- std::shared_ptr<facebook::react::Promise> promise) {
- taskType job = [=]() {
- std::string error = createOperationsError;
-
- if (!error.size()) {
- try {
- DatabaseManager::getQueryExecutor().beginTransaction();
- for (const auto &operation : *storeOpsPtr) {
- operation->execute();
- }
- DatabaseManager::getQueryExecutor().captureBackupLogs();
- DatabaseManager::getQueryExecutor().commitTransaction();
- } catch (std::system_error &e) {
- error = e.what();
- DatabaseManager::getQueryExecutor().rollbackTransaction();
- }
- }
-
- if (!error.size()) {
- ::triggerBackupFileUpload();
- }
-
- this->jsInvoker->invokeAsync([=]() {
- if (error.size()) {
- promise->reject(error);
- } else {
- promise->resolve(jsi::Value::undefined());
- }
- });
- };
- GlobalDBSingleton::instance.scheduleOrRunCancellable(
- job, promise, this->jsInvoker);
- });
- }
-
void processStoreOperationsSync(jsi::Runtime &rt, jsi::Array &&operations) {
std::vector<std::unique_ptr<Operation>> storeOps;
diff --git a/native/cpp/CommonCpp/_generated/commJSI-generated.cpp b/native/cpp/CommonCpp/_generated/commJSI-generated.cpp
--- a/native/cpp/CommonCpp/_generated/commJSI-generated.cpp
+++ b/native/cpp/CommonCpp/_generated/commJSI-generated.cpp
@@ -30,12 +30,6 @@
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessagesSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllMessagesSync(rt);
}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processDraftStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processDraftStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processMessageStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperationsSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processMessageStoreOperationsSync(rt, args[0].asObject(rt).asArray(rt));
return jsi::Value::undefined();
@@ -43,12 +37,6 @@
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllThreadsSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllThreadsSync(rt);
}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processThreadStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processThreadStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processReportStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processReportStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processReportStoreOperationsSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processReportStoreOperationsSync(rt, args[0].asObject(rt).asArray(rt));
return jsi::Value::undefined();
@@ -57,27 +45,6 @@
static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processThreadStoreOperationsSync(rt, args[0].asObject(rt).asArray(rt));
return jsi::Value::undefined();
}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processUserStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processUserStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processKeyserverStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processKeyserverStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processCommunityStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processCommunityStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processIntegrityStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processIntegrityStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processSyncedMetadataStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processSyncedMetadataStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processAuxUserStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processAuxUserStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processThreadActivityStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processThreadActivityStoreOperations(rt, args[0].asObject(rt).asArray(rt));
-}
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processDBStoreOperations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->processDBStoreOperations(rt, args[0].asObject(rt));
}
@@ -220,21 +187,10 @@
methodMap_["getClientDBStore"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getClientDBStore};
methodMap_["removeAllDrafts"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeAllDrafts};
methodMap_["getAllMessagesSync"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllMessagesSync};
- methodMap_["processDraftStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processDraftStoreOperations};
- methodMap_["processMessageStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperations};
methodMap_["processMessageStoreOperationsSync"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processMessageStoreOperationsSync};
methodMap_["getAllThreadsSync"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllThreadsSync};
- methodMap_["processThreadStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processThreadStoreOperations};
- methodMap_["processReportStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processReportStoreOperations};
methodMap_["processReportStoreOperationsSync"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processReportStoreOperationsSync};
methodMap_["processThreadStoreOperationsSync"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processThreadStoreOperationsSync};
- methodMap_["processUserStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processUserStoreOperations};
- methodMap_["processKeyserverStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processKeyserverStoreOperations};
- methodMap_["processCommunityStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processCommunityStoreOperations};
- methodMap_["processIntegrityStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processIntegrityStoreOperations};
- methodMap_["processSyncedMetadataStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processSyncedMetadataStoreOperations};
- methodMap_["processAuxUserStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processAuxUserStoreOperations};
- methodMap_["processThreadActivityStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processThreadActivityStoreOperations};
methodMap_["processDBStoreOperations"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_processDBStoreOperations};
methodMap_["initializeCryptoAccount"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_initializeCryptoAccount};
methodMap_["getUserPublicKey"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getUserPublicKey};
diff --git a/native/cpp/CommonCpp/_generated/commJSI.h b/native/cpp/CommonCpp/_generated/commJSI.h
--- a/native/cpp/CommonCpp/_generated/commJSI.h
+++ b/native/cpp/CommonCpp/_generated/commJSI.h
@@ -26,21 +26,10 @@
virtual jsi::Value getClientDBStore(jsi::Runtime &rt) = 0;
virtual jsi::Value removeAllDrafts(jsi::Runtime &rt) = 0;
virtual jsi::Array getAllMessagesSync(jsi::Runtime &rt) = 0;
- virtual jsi::Value processDraftStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processMessageStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
virtual void processMessageStoreOperationsSync(jsi::Runtime &rt, jsi::Array operations) = 0;
virtual jsi::Array getAllThreadsSync(jsi::Runtime &rt) = 0;
- virtual jsi::Value processThreadStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processReportStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
virtual void processReportStoreOperationsSync(jsi::Runtime &rt, jsi::Array operations) = 0;
virtual void processThreadStoreOperationsSync(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processUserStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processKeyserverStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processCommunityStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processIntegrityStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processSyncedMetadataStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processAuxUserStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
- virtual jsi::Value processThreadActivityStoreOperations(jsi::Runtime &rt, jsi::Array operations) = 0;
virtual jsi::Value processDBStoreOperations(jsi::Runtime &rt, jsi::Object operations) = 0;
virtual jsi::Value initializeCryptoAccount(jsi::Runtime &rt) = 0;
virtual jsi::Value getUserPublicKey(jsi::Runtime &rt) = 0;
@@ -153,22 +142,6 @@
return bridging::callFromJs<jsi::Array>(
rt, &T::getAllMessagesSync, jsInvoker_, instance_);
}
- jsi::Value processDraftStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processDraftStoreOperations) == 2,
- "Expected processDraftStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processDraftStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processMessageStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processMessageStoreOperations) == 2,
- "Expected processMessageStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processMessageStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
void processMessageStoreOperationsSync(jsi::Runtime &rt, jsi::Array operations) override {
static_assert(
bridging::getParameterCount(&T::processMessageStoreOperationsSync) == 2,
@@ -185,22 +158,6 @@
return bridging::callFromJs<jsi::Array>(
rt, &T::getAllThreadsSync, jsInvoker_, instance_);
}
- jsi::Value processThreadStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processThreadStoreOperations) == 2,
- "Expected processThreadStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processThreadStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processReportStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processReportStoreOperations) == 2,
- "Expected processReportStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processReportStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
void processReportStoreOperationsSync(jsi::Runtime &rt, jsi::Array operations) override {
static_assert(
bridging::getParameterCount(&T::processReportStoreOperationsSync) == 2,
@@ -217,62 +174,6 @@
return bridging::callFromJs<void>(
rt, &T::processThreadStoreOperationsSync, jsInvoker_, instance_, std::move(operations));
}
- jsi::Value processUserStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processUserStoreOperations) == 2,
- "Expected processUserStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processUserStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processKeyserverStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processKeyserverStoreOperations) == 2,
- "Expected processKeyserverStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processKeyserverStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processCommunityStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processCommunityStoreOperations) == 2,
- "Expected processCommunityStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processCommunityStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processIntegrityStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processIntegrityStoreOperations) == 2,
- "Expected processIntegrityStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processIntegrityStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processSyncedMetadataStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processSyncedMetadataStoreOperations) == 2,
- "Expected processSyncedMetadataStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processSyncedMetadataStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processAuxUserStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processAuxUserStoreOperations) == 2,
- "Expected processAuxUserStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processAuxUserStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
- jsi::Value processThreadActivityStoreOperations(jsi::Runtime &rt, jsi::Array operations) override {
- static_assert(
- bridging::getParameterCount(&T::processThreadActivityStoreOperations) == 2,
- "Expected processThreadActivityStoreOperations(...) to have 2 parameters");
-
- return bridging::callFromJs<jsi::Value>(
- rt, &T::processThreadActivityStoreOperations, jsInvoker_, instance_, std::move(operations));
- }
jsi::Value processDBStoreOperations(jsi::Runtime &rt, jsi::Object operations) override {
static_assert(
bridging::getParameterCount(&T::processDBStoreOperations) == 2,
diff --git a/native/schema/CommCoreModuleSchema.js b/native/schema/CommCoreModuleSchema.js
--- a/native/schema/CommCoreModuleSchema.js
+++ b/native/schema/CommCoreModuleSchema.js
@@ -5,16 +5,9 @@
import { TurboModuleRegistry } from 'react-native';
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport.js';
-import type { ClientDBAuxUserStoreOperation } from 'lib/ops/aux-user-store-ops.js';
-import type { ClientDBCommunityStoreOperation } from 'lib/ops/community-store-ops.js';
-import type { ClientDBIntegrityStoreOperation } from 'lib/ops/integrity-store-ops.js';
-import type { ClientDBKeyserverStoreOperation } from 'lib/ops/keyserver-store-ops';
import type { ClientDBMessageStoreOperation } from 'lib/ops/message-store-ops.js';
import type { ClientDBReportStoreOperation } from 'lib/ops/report-store-ops.js';
-import type { ClientDBSyncedMetadataStoreOperation } from 'lib/ops/synced-metadata-store-ops.js';
-import type { ClientDBThreadActivityStoreOperation } from 'lib/ops/thread-activity-store-ops.js';
import type { ClientDBThreadStoreOperation } from 'lib/ops/thread-store-ops.js';
-import type { ClientDBUserStoreOperation } from 'lib/ops/user-store-ops';
import type {
OneTimeKeysResult,
SignedPrekeys,
@@ -22,7 +15,6 @@
EncryptedData,
OutboundSessionCreationResult,
} from 'lib/types/crypto-types.js';
-import type { ClientDBDraftStoreOperation } from 'lib/types/draft-types.js';
import type { ClientDBMessageInfo } from 'lib/types/message-types.js';
import type { SIWEBackupSecrets } from 'lib/types/siwe-types.js';
import type { ReceivedMessageToDevice } from 'lib/types/sqlite-types.js';
@@ -45,49 +37,16 @@
+getClientDBStore: () => Promise<ClientDBStore>;
+removeAllDrafts: () => Promise<void>;
+getAllMessagesSync: () => $ReadOnlyArray<ClientDBMessageInfo>;
- +processDraftStoreOperations: (
- operations: $ReadOnlyArray<ClientDBDraftStoreOperation>,
- ) => Promise<void>;
- +processMessageStoreOperations: (
- operations: $ReadOnlyArray<ClientDBMessageStoreOperation>,
- ) => Promise<void>;
+processMessageStoreOperationsSync: (
operations: $ReadOnlyArray<ClientDBMessageStoreOperation>,
) => void;
+getAllThreadsSync: () => $ReadOnlyArray<ClientDBThreadInfo>;
- +processThreadStoreOperations: (
- operations: $ReadOnlyArray<ClientDBThreadStoreOperation>,
- ) => Promise<void>;
- +processReportStoreOperations: (
- operations: $ReadOnlyArray<ClientDBReportStoreOperation>,
- ) => Promise<void>;
+processReportStoreOperationsSync: (
operations: $ReadOnlyArray<ClientDBReportStoreOperation>,
) => void;
+processThreadStoreOperationsSync: (
operations: $ReadOnlyArray<ClientDBThreadStoreOperation>,
) => void;
- +processUserStoreOperations: (
- operations: $ReadOnlyArray<ClientDBUserStoreOperation>,
- ) => Promise<void>;
- +processKeyserverStoreOperations: (
- operations: $ReadOnlyArray<ClientDBKeyserverStoreOperation>,
- ) => Promise<void>;
- +processCommunityStoreOperations: (
- operations: $ReadOnlyArray<ClientDBCommunityStoreOperation>,
- ) => Promise<void>;
- +processIntegrityStoreOperations: (
- operations: $ReadOnlyArray<ClientDBIntegrityStoreOperation>,
- ) => Promise<void>;
- +processSyncedMetadataStoreOperations: (
- operations: $ReadOnlyArray<ClientDBSyncedMetadataStoreOperation>,
- ) => Promise<void>;
- +processAuxUserStoreOperations: (
- operations: $ReadOnlyArray<ClientDBAuxUserStoreOperation>,
- ) => Promise<void>;
- +processThreadActivityStoreOperations: (
- operations: $ReadOnlyArray<ClientDBThreadActivityStoreOperation>,
- ) => Promise<void>;
+processDBStoreOperations: (operations: Object) => Promise<void>;
+initializeCryptoAccount: () => Promise<string>;
+getUserPublicKey: () => Promise<ClientPublicKeys>;

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 10:33 PM (15 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692751
Default Alt Text
D11923.diff (27 KB)

Event Timeline