The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Handle Network errors in messaging sync
Charles Bochet01c0378b7a91
diff --git a/packages/twenty-server/src/modules/messaging/common/services/messaging-error-handling.service.ts b/packages/twenty-server/src/modules/messaging/common/services/messaging-error-handling.service.tsindex c4448d83878..80d7b93d60a 100644--- a/packages/twenty-server/src/modules/messaging/common/services/messaging-error-handling.service.ts+++ b/packages/twenty-server/src/modules/messaging/common/services/messaging-error-handling.service.ts@@ -18,7 +18,7 @@ type SyncStep =| 'messages-import';export type GmailError = {- code: number;+ code: number | string;reason: string;};@@ -94,7 +94,21 @@ export class MessagingErrorHandlingService {workspaceId,);break;-+ case 'ECONNRESET':+ case 'ENOTFOUND':+ case 'ECONNABORTED':+ case 'ETIMEDOUT':+ case 'ERR_NETWORK':+ // We are currently mixing up Gmail Error code (HTTP status) and axios error code (ECONNRESET)++ // In case of a network error, we should retry the request+ await this.handleRateLimitExceeded(+ error,+ syncStep,+ messageChannel,+ workspaceId,+ );+ break;default:await this.messagingChannelSyncStatusService.markAsFailedUnknownAndFlushMessagesToImport(messageChannel.id,