From 47656479baa67c1bf71b669f9d69805d813a1611 Mon Sep 17 00:00:00 2001 From: Weiko Date: Wed, 28 Feb 2024 14:32:05 +0100 Subject: [PATCH] [messaging] fix empty history (#4218) --- .../workspace/messaging/services/gmail-partial-sync.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts b/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts index d62db8d2f..08771134a 100644 --- a/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts +++ b/packages/twenty-server/src/workspace/messaging/services/gmail-partial-sync.service.ts @@ -81,7 +81,7 @@ export class GmailPartialSyncService { throw new Error('No history id found'); } - if (newHistoryId === lastSyncHistoryId) { + if (newHistoryId === lastSyncHistoryId || !history?.history?.length) { this.logger.log( `gmail partial-sync for workspace ${workspaceId} and account ${connectedAccountId} done with nothing to update.`, );