From 25325622edc28792247580ad5f04139b4a88e552 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 19 Oct 2021 18:34:35 -0700 Subject: [PATCH] getMessageDescriptor: Log more information if we can't find conversation --- ts/background.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/background.ts b/ts/background.ts index d1412ea62c..5c2e473106 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2832,6 +2832,7 @@ export async function startApp(): Promise { const { data, confirm } = event; const messageDescriptor = getMessageDescriptor({ + confirm, ...data, // 'message' event: for 1:1 converations, the conversation is same as sender destination: data.source, @@ -3068,12 +3069,14 @@ export async function startApp(): Promise { // Works with 'sent' and 'message' data sent from MessageReceiver, with a little massage // at callsites to make sure both source and destination are populated. const getMessageDescriptor = ({ + confirm, message, source, sourceUuid, destination, destinationUuid, }: { + confirm: () => unknown; message: ProcessedDataMessage; source?: string; sourceUuid?: string; @@ -3162,8 +3165,9 @@ export async function startApp(): Promise { highTrust: true, }); if (!id) { + confirm(); throw new Error( - 'getMessageDescriptor: ensureContactIds returned falsey id' + `getMessageDescriptor/${message.timestamp}: ensureContactIds returned falsey id` ); } @@ -3184,6 +3188,7 @@ export async function startApp(): Promise { strictAssert(source && sourceUuid, 'Missing user number and uuid'); const messageDescriptor = getMessageDescriptor({ + confirm, ...data, // 'sent' event: the sender is always us!