Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b38dd8a92d | |||
| aafd9a8f3e | |||
| ad769ba14e | |||
| 0b8e0acd51 | |||
| d8c85eaba4 | |||
| 1832505f00 | |||
| 956f1fc268 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-e2e-testing",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.16",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-emails",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-front",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-server",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
+1
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -28,8 +28,11 @@ export class MicrosoftFetchByBatchService {
|
||||
await this.microsoftClientProvider.getMicrosoftClient(connectedAccount);
|
||||
|
||||
for (let i = 0; i < messageIds.length; i += batchLimit) {
|
||||
console.log('i', i);
|
||||
const batchMessageIds = messageIds.slice(i, i + batchLimit);
|
||||
|
||||
console.log('batchMessageIds', batchMessageIds);
|
||||
|
||||
messageIdsByBatch.push(batchMessageIds);
|
||||
|
||||
const batchRequests = batchMessageIds.map((messageId, index) => ({
|
||||
@@ -42,10 +45,14 @@ export class MicrosoftFetchByBatchService {
|
||||
},
|
||||
}));
|
||||
|
||||
console.log('batchRequests', batchRequests);
|
||||
|
||||
const batchResponse = await client
|
||||
.api('/$batch')
|
||||
.post({ requests: batchRequests });
|
||||
|
||||
console.log('batchResponse', batchResponse);
|
||||
|
||||
batchResponses.push(batchResponse);
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -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: [],
|
||||
};
|
||||
});
|
||||
|
||||
+2
-4
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
+14
-9
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||
import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
|
||||
import { MessageChannelSyncStatusService } from 'src/modules/messaging/common/services/message-channel-sync-status.service';
|
||||
import { MessageChannelWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
|
||||
@@ -25,6 +26,7 @@ export class MessageImportExceptionHandlerService {
|
||||
constructor(
|
||||
private readonly twentyORMManager: TwentyORMManager,
|
||||
private readonly messageChannelSyncStatusService: MessageChannelSyncStatusService,
|
||||
private readonly exceptionHandlerService: ExceptionHandlerService,
|
||||
) {}
|
||||
|
||||
public async handleDriverException(
|
||||
@@ -57,14 +59,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 +66,15 @@ export class MessageImportExceptionHandlerService {
|
||||
workspaceId,
|
||||
);
|
||||
break;
|
||||
case MessageImportDriverExceptionCode.UNKNOWN:
|
||||
case MessageImportDriverExceptionCode.UNKNOWN_NETWORK_ERROR:
|
||||
default:
|
||||
throw exception;
|
||||
await this.handleUnknownException(
|
||||
exception,
|
||||
messageChannel,
|
||||
workspaceId,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +154,10 @@ export class MessageImportExceptionHandlerService {
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
this.exceptionHandlerService.captureExceptions([
|
||||
`Unknown error occurred while importing messages for message channel ${messageChannel.id} in workspace ${workspaceId}: ${exception.message}`,
|
||||
]);
|
||||
|
||||
throw new MessageImportException(
|
||||
`Unknown error occurred while importing messages for message channel ${messageChannel.id} in workspace ${workspaceId}: ${exception.message}`,
|
||||
MessageImportExceptionCode.UNKNOWN,
|
||||
|
||||
+4
-1
@@ -122,7 +122,10 @@ export class MessagingMessagesImportService {
|
||||
'[TMP] Debugging messages import for account:',
|
||||
messageChannel.connectedAccount.id,
|
||||
);
|
||||
this.logger.log('[TMP] messageIdsToFetch:', messageIdsToFetch);
|
||||
this.logger.log(
|
||||
'[TMP] messageIdsToFetch:',
|
||||
messageIdsToFetch.join(', '),
|
||||
);
|
||||
}
|
||||
|
||||
if (!messageIdsToFetch?.length) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-shared",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"main": "dist/twenty-shared.cjs.js",
|
||||
"module": "dist/twenty-shared.esm.js",
|
||||
"license": "AGPL-3.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-ui",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"exports": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-website",
|
||||
"version": "0.50.0-canary",
|
||||
"version": "0.44.17",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"nx": "NX_DEFAULT_PROJECT=twenty-website node ../../node_modules/nx/bin/nx.js",
|
||||
|
||||
Reference in New Issue
Block a user