fix MailboxConcurrency And email format without @ (#11133)

This commit is contained in:
Guillim
2025-03-25 11:40:58 +01:00
committed by GitHub
parent de1f8a4706
commit 96c61df007
5 changed files with 16 additions and 24 deletions

View File

@ -58,14 +58,13 @@ export class CalendarEventImportErrorHandlerService {
break;
case CalendarEventImportDriverExceptionCode.UNKNOWN:
case CalendarEventImportDriverExceptionCode.UNKNOWN_NETWORK_ERROR:
default:
await this.handleUnknownException(
exception,
calendarChannel,
workspaceId,
);
break;
default:
throw exception;
}
}

View File

@ -104,6 +104,10 @@ export class MicrosoftGetMessagesService {
),
];
const safeParticipantsFormat = participants.filter((participant) => {
return participant.handle.includes('@');
});
return {
externalId: response.id,
subject: response.subject || '',
@ -116,7 +120,7 @@ export class MicrosoftGetMessagesService {
response.from.emailAddress.address,
connectedAccount,
),
participants: participants,
participants: safeParticipantsFormat,
attachments: [],
};
});

View File

@ -1,7 +1,5 @@
import { Injectable } from '@nestjs/common';
import { GraphError } from '@microsoft/microsoft-graph-client';
import {
MessageImportDriverException,
MessageImportDriverExceptionCode,
@ -9,7 +7,7 @@ import {
@Injectable()
export class MicrosoftHandleErrorService {
public handleMicrosoftMessageFetchError(error: GraphError): void {
public handleMicrosoftMessageFetchError(error: any): void {
if (!error.statusCode) {
throw new MessageImportDriverException(
`Microsoft Graph API unknown error: ${error}`,
@ -32,7 +30,7 @@ export class MicrosoftHandleErrorService {
}
throw new MessageImportDriverException(
`Microsoft Graph API error: ${error.message}`,
`Microsoft driver error: ${error.message}`,
MessageImportDriverExceptionCode.UNKNOWN,
);
}

View File

@ -57,14 +57,6 @@ export class MessageImportExceptionHandlerService {
workspaceId,
);
break;
case MessageImportDriverExceptionCode.UNKNOWN:
case MessageImportDriverExceptionCode.UNKNOWN_NETWORK_ERROR:
await this.handleUnknownException(
exception,
messageChannel,
workspaceId,
);
break;
case MessageImportDriverExceptionCode.SYNC_CURSOR_ERROR:
await this.handlePermanentException(
exception,
@ -72,8 +64,15 @@ export class MessageImportExceptionHandlerService {
workspaceId,
);
break;
case MessageImportDriverExceptionCode.UNKNOWN:
case MessageImportDriverExceptionCode.UNKNOWN_NETWORK_ERROR:
default:
throw exception;
await this.handleUnknownException(
exception,
messageChannel,
workspaceId,
);
break;
}
}

View File

@ -117,14 +117,6 @@ export class MessagingMessagesImportService {
MESSAGING_GMAIL_USERS_MESSAGES_GET_BATCH_SIZE,
);
if (connectedAccount.id === '74998005-0180-4d6a-9fa4-fe733c4707f8') {
this.logger.log(
'[TMP] Debugging messages import for account:',
messageChannel.connectedAccount.id,
);
this.logger.log('[TMP] messageIdsToFetch:', messageIdsToFetch);
}
if (!messageIdsToFetch?.length) {
await this.messageChannelSyncStatusService.markAsCompletedAndSchedulePartialMessageListFetch(
[messageChannel.id],