Skip to content

The open alternative to Salesforce, designed for AI.

Stop reporting revoked accounts to Sentry (#28287)

neo773e8d41b800ae6
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts
index 1b28a5d03e5..34da0549a40 100644
--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts
+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts
@@ -45,10 +45,7 @@ export class CalendarEventImportErrorHandlerService {
| TwentyOrmException
| ConnectedAccountRefreshAccessTokenException,
syncStep: CalendarEventImportSyncStep,
- calendarChannel: Pick<
- CalendarChannelEntity,
- 'id' | 'throttleFailureCount' | 'connectedAccountId'
- >,
+ calendarChannel: Pick<CalendarChannelEntity, 'id' | 'throttleFailureCount'>,
workspaceId: string,
): Promise<void> {
switch (exception.code) {
@@ -73,8 +70,6 @@ export class CalendarEventImportErrorHandlerService {
case ConnectedAccountRefreshAccessTokenExceptionCode.REFRESH_TOKEN_NOT_FOUND:
case ConnectedAccountRefreshAccessTokenExceptionCode.INVALID_REFRESH_TOKEN:
await this.handleInsufficientPermissionsException(
- exception,
- syncStep,
calendarChannel,
workspaceId,
);
@@ -176,20 +171,9 @@ export class CalendarEventImportErrorHandlerService {
}
private async handleInsufficientPermissionsException(
- exception: Error,
- syncStep: CalendarEventImportSyncStep,
- calendarChannel: Pick<CalendarChannelEntity, 'id' | 'connectedAccountId'>,
+ calendarChannel: Pick<CalendarChannelEntity, 'id'>,
workspaceId: string,
): Promise<void> {
- this.exceptionHandlerService.captureExceptions([exception], {
- additionalData: {
- calendarChannelId: calendarChannel.id,
- connectedAccountId: calendarChannel.connectedAccountId,
- syncStep,
- },
- workspace: { id: workspaceId },
- });
-
await this.calendarChannelSyncStatusService.markAsFailedInsufficientPermissionsAndFlushCalendarEventsToImport(
[calendarChannel.id],
workspaceId,
diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-import-exception-handler.service.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-import-exception-handler.service.ts
index cef8d1da9b2..063285a2871 100644
--- a/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-import-exception-handler.service.ts
+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-import-exception-handler.service.ts
@@ -98,16 +98,12 @@ export class MessageImportExceptionHandlerService {
message: `${exception.code}: ${exception.message ?? ''}`,
});
await this.handleInsufficientPermissionsException(
- exception,
- syncStep,
messageChannel,
workspaceId,
);
break;
case MessageImportDriverExceptionCode.INSUFFICIENT_PERMISSIONS:
await this.handleInsufficientPermissionsException(
- exception,
- syncStep,
messageChannel,
workspaceId,
);
@@ -244,20 +240,9 @@ export class MessageImportExceptionHandlerService {
}
private async handleInsufficientPermissionsException(
- exception: Error,
- syncStep: MessageImportSyncStep,
- messageChannel: Pick<MessageChannelEntity, 'id' | 'connectedAccountId'>,
+ messageChannel: Pick<MessageChannelEntity, 'id'>,
workspaceId: string,
): Promise<void> {
- this.exceptionHandlerService.captureExceptions([exception], {
- additionalData: {
- messageChannelId: messageChannel.id,
- connectedAccountId: messageChannel.connectedAccountId,
- syncStep,
- },
- workspace: { id: workspaceId },
- });
-
await this.messageChannelSyncStatusService.markAsFailed({
messageChannelIds: [messageChannel.id],
workspaceId,