From 9ebf7a61ab4e2436bb287e0e51a57f8d658bc44d Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sun, 9 Jun 2024 00:56:59 +0200 Subject: [PATCH] Remove threadId defined assertion as it could not be in messaging sync --- ...ing-gmail-fetch-messages-by-batches.service.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/services/messaging-gmail-fetch-messages-by-batches.service.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/services/messaging-gmail-fetch-messages-by-batches.service.ts index ed45d3622..be2b3e1a1 100644 --- a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/services/messaging-gmail-fetch-messages-by-batches.service.ts +++ b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/gmail/services/messaging-gmail-fetch-messages-by-batches.service.ts @@ -100,7 +100,7 @@ export class MessagingGmailFetchMessagesByBatchesService { if (!from) { this.logger.log( - `From value is missing while importing message in workspace ${workspaceId} and account ${connectedAccountId}`, + `From value is missing while importing message #${id} in workspace ${workspaceId} and account ${connectedAccountId}`, ); return null; @@ -108,7 +108,7 @@ export class MessagingGmailFetchMessagesByBatchesService { if (!to && !deliveredTo && !bcc && !cc) { this.logger.log( - `To, Delivered-To, Bcc or Cc value is missing while importing message in workspace ${workspaceId} and account ${connectedAccountId}`, + `To, Delivered-To, Bcc or Cc value is missing while importing message #${id} in workspace ${workspaceId} and account ${connectedAccountId}`, ); return null; @@ -116,7 +116,15 @@ export class MessagingGmailFetchMessagesByBatchesService { if (!headerMessageId) { this.logger.log( - `Header Message ID is missing while importing message in workspace ${workspaceId} and account ${connectedAccountId}`, + `Message-ID is missing while importing message #${id} in workspace ${workspaceId} and account ${connectedAccountId}`, + ); + + return null; + } + + if (!threadId) { + this.logger.log( + `Thread Id is missing while importing message #${id} in workspace ${workspaceId} and account ${connectedAccountId}`, ); return null; @@ -190,7 +198,6 @@ export class MessagingGmailFetchMessagesByBatchesService { const internalDate = message.internalDate; assert(id, 'ID is missing'); - assert(threadId, 'Thread-ID is missing'); assert(historyId, 'History-ID is missing'); assert(internalDate, 'Internal date is missing');