Page MenuHomePhabricator

D13031.diff
No OneTemporary

D13031.diff

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
@@ -61,6 +61,9 @@
messageID: string,
deviceID: string,
) => Promise<void>,
+ +resetOutboundP2PMessagesForDevice: (
+ deviceID: string,
+ ) => Promise<Array<string>>,
+removeOutboundP2PMessagesOlderThan: (
messageID: string,
deviceID: string,
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
@@ -40,6 +40,7 @@
getAllOutboundP2PMessages: jest.fn(),
markOutboundP2PMessageAsSent: jest.fn(),
removeOutboundP2PMessagesOlderThan: jest.fn(),
+ resetOutboundP2PMessagesForDevice: jest.fn(),
getRelatedMessages: jest.fn(),
getOutboundP2PMessagesByID: jest.fn(),
searchMessages: jest.fn(),
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
@@ -16,6 +16,8 @@
// write operations
removeInboundP2PMessages: commCoreModule.removeInboundP2PMessages,
markOutboundP2PMessageAsSent: commCoreModule.markOutboundP2PMessageAsSent,
+ resetOutboundP2PMessagesForDevice:
+ commCoreModule.resetOutboundP2PMessagesForDevice,
removeOutboundP2PMessagesOlderThan:
commCoreModule.removeOutboundP2PMessagesOlderThan,
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
@@ -102,6 +102,19 @@
});
},
+ async resetOutboundP2PMessagesForDevice(
+ deviceID: string,
+ ): Promise<Array<string>> {
+ const sharedWorker = await getCommSharedWorker();
+
+ const data = await sharedWorker.schedule({
+ type: workerRequestMessageTypes.RESET_OUTBOUND_P2P_MESSAGES,
+ deviceID,
+ });
+ const messageIDs: ?$ReadOnlyArray<string> = data?.messageIDs;
+ return messageIDs ? [...messageIDs] : [];
+ },
+
async removeOutboundP2PMessagesOlderThan(
messageID: string,
deviceID: string,

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 2:37 PM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571185
Default Alt Text
D13031.diff (2 KB)

Event Timeline