The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
[messaging] add more logs to gmail full-sync (#3728)
Weikoe787b4e3b862
diff --git a/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts b/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.tsindex 66006a906da..3ee1ced17ce 100644--- a/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts+++ b/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts@@ -82,6 +82,8 @@ export class FetchMessagesByBatchesService {},);+ console.log('responseFromGmailQuery', response);+return response;}diff --git a/packages/twenty-server/src/workspace/messaging/services/gmail-full-sync.service.ts b/packages/twenty-server/src/workspace/messaging/services/gmail-full-sync.service.tsindex 816c5fec72e..fbd3cbf6160 100644--- a/packages/twenty-server/src/workspace/messaging/services/gmail-full-sync.service.ts+++ b/packages/twenty-server/src/workspace/messaging/services/gmail-full-sync.service.ts@@ -67,6 +67,8 @@ export class GmailFullSyncService {pageToken: nextPageToken,});+ console.log('messageList query result from gmail', messages);+const messagesData = messages.data.messages;const messageExternalIds = messagesData@@ -84,6 +86,11 @@ export class GmailFullSyncService {workspaceId,);+ console.log(+ 'existingMessagesInDB',+ existingMessageChannelMessageAssociations,+ );+const existingMessageChannelMessageAssociationsExternalIds =existingMessageChannelMessageAssociations.map((messageChannelMessageAssociation) =>@@ -97,6 +104,8 @@ export class GmailFullSyncService {),);+ console.log('newMessagesToFetch', messagesToFetch);+const messageQueries =this.utils.createQueriesFromMessageIds(messagesToFetch);@@ -106,6 +115,8 @@ export class GmailFullSyncService {accessToken,);+ console.log('messagesToSave', messagesToSave);+if (messagesToSave.length === 0) {return;}@@ -135,6 +146,12 @@ export class GmailFullSyncService {workspaceId,);+ console.log(+ `gmail full-sync for workspace ${workspaceId} and account ${connectedAccountId} ${+ nextPageToken ? `and ${nextPageToken} pageToken` : ''+ } done.`,+ );+if (messages.data.nextPageToken) {await this.messageQueueService.add<GmailFullSyncJobData>(GmailFullSyncJob.name,