getMessageDescriptor: Log more information if we can't find conversation
This commit is contained in:
parent
0b57bcd36c
commit
25325622ed
1 changed files with 6 additions and 1 deletions
|
@ -2832,6 +2832,7 @@ export async function startApp(): Promise<void> {
|
||||||
const { data, confirm } = event;
|
const { data, confirm } = event;
|
||||||
|
|
||||||
const messageDescriptor = getMessageDescriptor({
|
const messageDescriptor = getMessageDescriptor({
|
||||||
|
confirm,
|
||||||
...data,
|
...data,
|
||||||
// 'message' event: for 1:1 converations, the conversation is same as sender
|
// 'message' event: for 1:1 converations, the conversation is same as sender
|
||||||
destination: data.source,
|
destination: data.source,
|
||||||
|
@ -3068,12 +3069,14 @@ export async function startApp(): Promise<void> {
|
||||||
// Works with 'sent' and 'message' data sent from MessageReceiver, with a little massage
|
// Works with 'sent' and 'message' data sent from MessageReceiver, with a little massage
|
||||||
// at callsites to make sure both source and destination are populated.
|
// at callsites to make sure both source and destination are populated.
|
||||||
const getMessageDescriptor = ({
|
const getMessageDescriptor = ({
|
||||||
|
confirm,
|
||||||
message,
|
message,
|
||||||
source,
|
source,
|
||||||
sourceUuid,
|
sourceUuid,
|
||||||
destination,
|
destination,
|
||||||
destinationUuid,
|
destinationUuid,
|
||||||
}: {
|
}: {
|
||||||
|
confirm: () => unknown;
|
||||||
message: ProcessedDataMessage;
|
message: ProcessedDataMessage;
|
||||||
source?: string;
|
source?: string;
|
||||||
sourceUuid?: string;
|
sourceUuid?: string;
|
||||||
|
@ -3162,8 +3165,9 @@ export async function startApp(): Promise<void> {
|
||||||
highTrust: true,
|
highTrust: true,
|
||||||
});
|
});
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
confirm();
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'getMessageDescriptor: ensureContactIds returned falsey id'
|
`getMessageDescriptor/${message.timestamp}: ensureContactIds returned falsey id`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3184,6 +3188,7 @@ export async function startApp(): Promise<void> {
|
||||||
strictAssert(source && sourceUuid, 'Missing user number and uuid');
|
strictAssert(source && sourceUuid, 'Missing user number and uuid');
|
||||||
|
|
||||||
const messageDescriptor = getMessageDescriptor({
|
const messageDescriptor = getMessageDescriptor({
|
||||||
|
confirm,
|
||||||
...data,
|
...data,
|
||||||
|
|
||||||
// 'sent' event: the sender is always us!
|
// 'sent' event: the sender is always us!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue