Remove messageId defined assertion as it could not be in messaging sync (#5784)
Instead, we will log but ignore the message
This commit is contained in:
@ -114,6 +114,14 @@ export class MessagingGmailFetchMessagesByBatchesService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!headerMessageId) {
|
||||||
|
this.logger.log(
|
||||||
|
`Header Message ID is missing while importing message in workspace ${workspaceId} and account ${connectedAccountId}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const participants = [
|
const participants = [
|
||||||
...formatAddressObjectAsParticipants(from, 'from'),
|
...formatAddressObjectAsParticipants(from, 'from'),
|
||||||
...formatAddressObjectAsParticipants(to ?? deliveredTo, 'to'),
|
...formatAddressObjectAsParticipants(to ?? deliveredTo, 'to'),
|
||||||
@ -182,10 +190,6 @@ export class MessagingGmailFetchMessagesByBatchesService {
|
|||||||
const internalDate = message.internalDate;
|
const internalDate = message.internalDate;
|
||||||
|
|
||||||
assert(id, 'ID is missing');
|
assert(id, 'ID is missing');
|
||||||
assert(
|
|
||||||
messageId,
|
|
||||||
'Message-ID is missing: ' + JSON.stringify(message.payload?.headers),
|
|
||||||
);
|
|
||||||
assert(threadId, 'Thread-ID is missing');
|
assert(threadId, 'Thread-ID is missing');
|
||||||
assert(historyId, 'History-ID is missing');
|
assert(historyId, 'History-ID is missing');
|
||||||
assert(internalDate, 'Internal date is missing');
|
assert(internalDate, 'Internal date is missing');
|
||||||
|
|||||||
@ -158,6 +158,7 @@ export class MessagingGmailMessagesImportService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (error.code === undefined) {
|
if (error.code === undefined) {
|
||||||
|
// This should never happen as all errors must be known
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user