Page MenuHomePhabricator

D12738.id42316.diff
No OneTemporary

D12738.id42316.diff

diff --git a/web/shared-worker/worker/shared-worker.js b/web/shared-worker/worker/shared-worker.js
--- a/web/shared-worker/worker/shared-worker.js
+++ b/web/shared-worker/worker/shared-worker.js
@@ -39,6 +39,7 @@
} from '../../types/worker-types.js';
import { workerIdentityClientRequests } from '../../types/worker-types.js';
import { getDatabaseModule } from '../db-module.js';
+import { webMessageToClientDBMessageInfo } from '../types/entities.js';
import {
COMM_SQLITE_DATABASE_PATH,
SQLITE_STAMPED_USER_ID_KEY,
@@ -252,6 +253,14 @@
type: workerResponseMessageTypes.GET_OUTBOUND_P2P_MESSAGES,
outboundP2PMessages: sqliteQueryExecutor.getAllOutboundP2PMessages(),
};
+ } else if (message.type === workerRequestMessageTypes.GET_RELATED_MESSAGES) {
+ const webMessageEntities = sqliteQueryExecutor.getRelatedMessagesWeb(
+ message.messageID,
+ );
+ return {
+ type: workerResponseMessageTypes.GET_RELATED_MESSAGES,
+ messages: webMessageEntities.map(webMessageToClientDBMessageInfo),
+ };
}
// write operations
diff --git a/web/types/worker-types.js b/web/types/worker-types.js
--- a/web/types/worker-types.js
+++ b/web/types/worker-types.js
@@ -11,6 +11,7 @@
IdentityServiceClient,
IdentityServiceAuthLayer,
} from 'lib/types/identity-service-types.js';
+import type { ClientDBMessageInfo } from 'lib/types/message-types.js';
import type {
InboundP2PMessage,
OutboundP2PMessage,
@@ -43,6 +44,7 @@
GET_OUTBOUND_P2P_MESSAGES: 18,
MARK_OUTBOUND_P2P_MESSAGE_AS_SENT: 19,
REMOVE_OUTBOUND_P2P_MESSAGES: 20,
+ GET_RELATED_MESSAGES: 21,
});
export const workerWriteRequests: $ReadOnlyArray<number> = [
@@ -188,6 +190,11 @@
+deviceID: string,
};
+export type GetRelatedMessagesRequestMessage = {
+ +type: 21,
+ +messageID: string,
+};
+
export type WorkerRequestMessage =
| PingWorkerRequestMessage
| InitWorkerRequestMessage
@@ -209,7 +216,8 @@
| RemoveInboundP2PMessagesRequestMessage
| GetOutboundP2PMessagesRequestMessage
| MarkOutboundP2PMessageAsSentRequestMessage
- | RemoveOutboundP2PMessagesRequestMessage;
+ | RemoveOutboundP2PMessagesRequestMessage
+ | GetRelatedMessagesRequestMessage;
export type WorkerRequestProxyMessage = {
+id: number,
@@ -226,6 +234,7 @@
CALL_OLM_API_METHOD: 5,
GET_INBOUND_P2P_MESSAGES: 6,
GET_OUTBOUND_P2P_MESSAGES: 7,
+ GET_RELATED_MESSAGES: 8,
});
export type PongWorkerResponseMessage = {
@@ -268,6 +277,11 @@
+outboundP2PMessages: $ReadOnlyArray<OutboundP2PMessage>,
};
+export type GetRelatedMessagesResponseMessage = {
+ +type: 8,
+ +messages: $ReadOnlyArray<ClientDBMessageInfo>,
+};
+
export type WorkerResponseMessage =
| PongWorkerResponseMessage
| ClientStoreResponseMessage
@@ -276,7 +290,8 @@
| CallIdentityClientMethodResponseMessage
| CallOLMApiMethodResponseMessage
| GetInboundP2PMessagesResponseMessage
- | GetOutboundP2PMessagesResponseMessage;
+ | GetOutboundP2PMessagesResponseMessage
+ | GetRelatedMessagesResponseMessage;
export type WorkerResponseProxyMessage = {
+id?: number,

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 5:09 AM (18 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2448964
Default Alt Text
D12738.id42316.diff (3 KB)

Event Timeline