Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3402533
D12804.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
13 KB
Referenced Files
None
Subscribers
None
D12804.diff
View Options
diff --git a/lib/tunnelbroker/peer-to-peer-context.js b/lib/tunnelbroker/peer-to-peer-context.js
--- a/lib/tunnelbroker/peer-to-peer-context.js
+++ b/lib/tunnelbroker/peer-to-peer-context.js
@@ -57,7 +57,7 @@
if (messageIDs) {
messages = await sqliteAPI.getOutboundP2PMessagesByID(messageIDs);
} else {
- const allMessages = await sqliteAPI.getAllOutboundP2PMessage();
+ const allMessages = await sqliteAPI.getAllOutboundP2PMessages();
messages = allMessages.filter(message => message.supportsAutoRetry);
}
diff --git a/lib/types/sqlite-types.js b/lib/types/sqlite-types.js
--- a/lib/types/sqlite-types.js
+++ b/lib/types/sqlite-types.js
@@ -40,8 +40,8 @@
export type SQLiteAPI = {
// read operations
- +getAllInboundP2PMessage: () => Promise<Array<InboundP2PMessage>>,
- +getAllOutboundP2PMessage: () => Promise<Array<OutboundP2PMessage>>,
+ +getAllInboundP2PMessages: () => Promise<Array<InboundP2PMessage>>,
+ +getAllOutboundP2PMessages: () => Promise<Array<OutboundP2PMessage>>,
+getRelatedMessages: (
messageID: string,
) => Promise<Array<ClientDBMessageInfo>>,
diff --git a/lib/utils/__mocks__/config.js b/lib/utils/__mocks__/config.js
--- a/lib/utils/__mocks__/config.js
+++ b/lib/utils/__mocks__/config.js
@@ -29,10 +29,10 @@
markPrekeysAsPublished: jest.fn(),
},
sqliteAPI: {
- getAllInboundP2PMessage: jest.fn(),
+ getAllInboundP2PMessages: jest.fn(),
removeInboundP2PMessages: jest.fn(),
processDBStoreOperations: jest.fn(),
- getAllOutboundP2PMessage: jest.fn(),
+ getAllOutboundP2PMessages: jest.fn(),
markOutboundP2PMessageAsSent: jest.fn(),
removeOutboundP2PMessagesOlderThan: jest.fn(),
getRelatedMessages: jest.fn(),
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
@@ -219,12 +219,12 @@
jsi::Object siweBackupSecrets) override;
virtual jsi::Value retrieveLatestSIWEBackupData(jsi::Runtime &rt) override;
virtual jsi::Value getSIWEBackupSecrets(jsi::Runtime &rt) override;
- virtual jsi::Value getAllInboundP2PMessage(jsi::Runtime &rt) override;
+ virtual jsi::Value getAllInboundP2PMessages(jsi::Runtime &rt) override;
virtual jsi::Value
removeInboundP2PMessages(jsi::Runtime &rt, jsi::Array ids) override;
virtual jsi::Value
getOutboundP2PMessagesByID(jsi::Runtime &rt, jsi::Array ids) override;
- virtual jsi::Value getAllOutboundP2PMessage(jsi::Runtime &rt) override;
+ virtual jsi::Value getAllOutboundP2PMessages(jsi::Runtime &rt) override;
virtual jsi::Value markOutboundP2PMessageAsSent(
jsi::Runtime &rt,
jsi::String messageID,
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
@@ -2349,7 +2349,7 @@
});
}
-jsi::Value CommCoreModule::getAllInboundP2PMessage(jsi::Runtime &rt) {
+jsi::Value CommCoreModule::getAllInboundP2PMessages(jsi::Runtime &rt) {
return createPromiseAsJSIValue(
rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
taskType job = [=, &innerRt]() {
@@ -2484,7 +2484,7 @@
});
}
-jsi::Value CommCoreModule::getAllOutboundP2PMessage(jsi::Runtime &rt) {
+jsi::Value CommCoreModule::getAllOutboundP2PMessages(jsi::Runtime &rt) {
return createPromiseAsJSIValue(
rt, [=](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
taskType job = [=, &innerRt]() {
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
@@ -187,8 +187,8 @@
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getSIWEBackupSecrets(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getSIWEBackupSecrets(rt);
}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllInboundP2PMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllInboundP2PMessage(rt);
+static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllInboundP2PMessages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
+ return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllInboundP2PMessages(rt);
}
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeInboundP2PMessages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->removeInboundP2PMessages(rt, args[0].asObject(rt).asArray(rt));
@@ -196,8 +196,8 @@
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getOutboundP2PMessagesByID(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getOutboundP2PMessagesByID(rt, args[0].asObject(rt).asArray(rt));
}
-static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllOutboundP2PMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
- return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllOutboundP2PMessage(rt);
+static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllOutboundP2PMessages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
+ return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->getAllOutboundP2PMessages(rt);
}
static jsi::Value __hostFunction_CommCoreModuleSchemaCxxSpecJSI_markOutboundP2PMessageAsSent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<CommCoreModuleSchemaCxxSpecJSI *>(&turboModule)->markOutboundP2PMessageAsSent(rt, args[0].asString(rt), args[1].asString(rt));
@@ -273,10 +273,10 @@
methodMap_["retrieveLatestSIWEBackupData"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_retrieveLatestSIWEBackupData};
methodMap_["setSIWEBackupSecrets"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_setSIWEBackupSecrets};
methodMap_["getSIWEBackupSecrets"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getSIWEBackupSecrets};
- methodMap_["getAllInboundP2PMessage"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllInboundP2PMessage};
+ methodMap_["getAllInboundP2PMessages"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllInboundP2PMessages};
methodMap_["removeInboundP2PMessages"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeInboundP2PMessages};
methodMap_["getOutboundP2PMessagesByID"] = MethodMetadata {1, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getOutboundP2PMessagesByID};
- methodMap_["getAllOutboundP2PMessage"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllOutboundP2PMessage};
+ methodMap_["getAllOutboundP2PMessages"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getAllOutboundP2PMessages};
methodMap_["markOutboundP2PMessageAsSent"] = MethodMetadata {2, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_markOutboundP2PMessageAsSent};
methodMap_["removeOutboundP2PMessagesOlderThan"] = MethodMetadata {2, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_removeOutboundP2PMessagesOlderThan};
methodMap_["getSyncedDatabaseVersion"] = MethodMetadata {0, __hostFunction_CommCoreModuleSchemaCxxSpecJSI_getSyncedDatabaseVersion};
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
@@ -76,10 +76,10 @@
virtual jsi::Value retrieveLatestSIWEBackupData(jsi::Runtime &rt) = 0;
virtual jsi::Value setSIWEBackupSecrets(jsi::Runtime &rt, jsi::Object siweBackupSecrets) = 0;
virtual jsi::Value getSIWEBackupSecrets(jsi::Runtime &rt) = 0;
- virtual jsi::Value getAllInboundP2PMessage(jsi::Runtime &rt) = 0;
+ virtual jsi::Value getAllInboundP2PMessages(jsi::Runtime &rt) = 0;
virtual jsi::Value removeInboundP2PMessages(jsi::Runtime &rt, jsi::Array ids) = 0;
virtual jsi::Value getOutboundP2PMessagesByID(jsi::Runtime &rt, jsi::Array ids) = 0;
- virtual jsi::Value getAllOutboundP2PMessage(jsi::Runtime &rt) = 0;
+ virtual jsi::Value getAllOutboundP2PMessages(jsi::Runtime &rt) = 0;
virtual jsi::Value markOutboundP2PMessageAsSent(jsi::Runtime &rt, jsi::String messageID, jsi::String deviceID) = 0;
virtual jsi::Value removeOutboundP2PMessagesOlderThan(jsi::Runtime &rt, jsi::String messageID, jsi::String deviceID) = 0;
virtual jsi::Value getSyncedDatabaseVersion(jsi::Runtime &rt) = 0;
@@ -554,13 +554,13 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::getSIWEBackupSecrets, jsInvoker_, instance_);
}
- jsi::Value getAllInboundP2PMessage(jsi::Runtime &rt) override {
+ jsi::Value getAllInboundP2PMessages(jsi::Runtime &rt) override {
static_assert(
- bridging::getParameterCount(&T::getAllInboundP2PMessage) == 1,
- "Expected getAllInboundP2PMessage(...) to have 1 parameters");
+ bridging::getParameterCount(&T::getAllInboundP2PMessages) == 1,
+ "Expected getAllInboundP2PMessages(...) to have 1 parameters");
return bridging::callFromJs<jsi::Value>(
- rt, &T::getAllInboundP2PMessage, jsInvoker_, instance_);
+ rt, &T::getAllInboundP2PMessages, jsInvoker_, instance_);
}
jsi::Value removeInboundP2PMessages(jsi::Runtime &rt, jsi::Array ids) override {
static_assert(
@@ -578,13 +578,13 @@
return bridging::callFromJs<jsi::Value>(
rt, &T::getOutboundP2PMessagesByID, jsInvoker_, instance_, std::move(ids));
}
- jsi::Value getAllOutboundP2PMessage(jsi::Runtime &rt) override {
+ jsi::Value getAllOutboundP2PMessages(jsi::Runtime &rt) override {
static_assert(
- bridging::getParameterCount(&T::getAllOutboundP2PMessage) == 1,
- "Expected getAllOutboundP2PMessage(...) to have 1 parameters");
+ bridging::getParameterCount(&T::getAllOutboundP2PMessages) == 1,
+ "Expected getAllOutboundP2PMessages(...) to have 1 parameters");
return bridging::callFromJs<jsi::Value>(
- rt, &T::getAllOutboundP2PMessage, jsInvoker_, instance_);
+ rt, &T::getAllOutboundP2PMessages, jsInvoker_, instance_);
}
jsi::Value markOutboundP2PMessageAsSent(jsi::Runtime &rt, jsi::String messageID, jsi::String deviceID) override {
static_assert(
diff --git a/native/database/sqlite-api.js b/native/database/sqlite-api.js
--- a/native/database/sqlite-api.js
+++ b/native/database/sqlite-api.js
@@ -7,8 +7,8 @@
const sqliteAPI: SQLiteAPI = {
// read operations
- getAllInboundP2PMessage: commCoreModule.getAllInboundP2PMessage,
- getAllOutboundP2PMessage: commCoreModule.getAllOutboundP2PMessage,
+ getAllInboundP2PMessages: commCoreModule.getAllInboundP2PMessages,
+ getAllOutboundP2PMessages: commCoreModule.getAllOutboundP2PMessages,
getRelatedMessages: commCoreModule.getRelatedMessages,
getOutboundP2PMessagesByID: commCoreModule.getOutboundP2PMessagesByID,
diff --git a/native/schema/CommCoreModuleSchema.js b/native/schema/CommCoreModuleSchema.js
--- a/native/schema/CommCoreModuleSchema.js
+++ b/native/schema/CommCoreModuleSchema.js
@@ -152,12 +152,12 @@
+retrieveLatestSIWEBackupData: () => Promise<string>;
+setSIWEBackupSecrets: (siweBackupSecrets: Object) => Promise<void>;
+getSIWEBackupSecrets: () => Promise<?Object>;
- +getAllInboundP2PMessage: () => Promise<InboundP2PMessage[]>;
+ +getAllInboundP2PMessages: () => Promise<InboundP2PMessage[]>;
+removeInboundP2PMessages: (ids: $ReadOnlyArray<string>) => Promise<void>;
+getOutboundP2PMessagesByID: (
ids: $ReadOnlyArray<string>,
) => Promise<Array<OutboundP2PMessage>>;
- +getAllOutboundP2PMessage: () => Promise<OutboundP2PMessage[]>;
+ +getAllOutboundP2PMessages: () => Promise<OutboundP2PMessage[]>;
+markOutboundP2PMessageAsSent: (
messageID: string,
deviceID: string,
diff --git a/web/database/sqlite-api.js b/web/database/sqlite-api.js
--- a/web/database/sqlite-api.js
+++ b/web/database/sqlite-api.js
@@ -13,7 +13,7 @@
const sqliteAPI: SQLiteAPI = {
// read operations
- async getAllInboundP2PMessage(): Promise<InboundP2PMessage[]> {
+ async getAllInboundP2PMessages(): Promise<InboundP2PMessage[]> {
const sharedWorker = await getCommSharedWorker();
const data = await sharedWorker.schedule({
@@ -24,7 +24,7 @@
return messages ? [...messages] : [];
},
- async getAllOutboundP2PMessage(): Promise<OutboundP2PMessage[]> {
+ async getAllOutboundP2PMessages(): Promise<OutboundP2PMessage[]> {
const sharedWorker = await getCommSharedWorker();
const data = await sharedWorker.schedule({
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 5:13 PM (3 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2612487
Default Alt Text
D12804.diff (13 KB)
Attached To
Mode
D12804: [native][web] Rename P2P messages methods
Attached
Detach File
Event Timeline
Log In to Comment