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:
Charles Bochet
2024-06-09 00:15:12 +02:00
committed by GitHub
parent d4610774fa
commit f2cd65557e
2 changed files with 9 additions and 4 deletions

View File

@ -114,6 +114,14 @@ export class MessagingGmailFetchMessagesByBatchesService {
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 = [
...formatAddressObjectAsParticipants(from, 'from'),
...formatAddressObjectAsParticipants(to ?? deliveredTo, 'to'),
@ -182,10 +190,6 @@ export class MessagingGmailFetchMessagesByBatchesService {
const internalDate = message.internalDate;
assert(id, 'ID is missing');
assert(
messageId,
'Message-ID is missing: ' + JSON.stringify(message.payload?.headers),
);
assert(threadId, 'Thread-ID is missing');
assert(historyId, 'History-ID is missing');
assert(internalDate, 'Internal date is missing');

View File

@ -158,6 +158,7 @@ export class MessagingGmailMessagesImportService {
);
if (error.code === undefined) {
// This should never happen as all errors must be known
throw error;
}