diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/states/selectors/calendarDayRecordsComponentFamilySelector.ts b/packages/twenty-front/src/modules/object-record/record-calendar/states/selectors/calendarDayRecordsComponentFamilySelector.ts index 4233126f1a0..68470cf3bce 100644 --- a/packages/twenty-front/src/modules/object-record/record-calendar/states/selectors/calendarDayRecordsComponentFamilySelector.ts +++ b/packages/twenty-front/src/modules/object-record/record-calendar/states/selectors/calendarDayRecordsComponentFamilySelector.ts @@ -9,11 +9,7 @@ import { createAtomComponentFamilySelector } from '@/ui/utilities/state/jotai/ut import { isNonEmptyString } from '@sniptt/guards'; import { Temporal } from 'temporal-polyfill'; -import { - isDefined, - isSamePlainDate, - parseToPlainDateOrThrow, -} from 'twenty-shared/utils'; +import { isDefined, isSamePlainDate } from 'twenty-shared/utils'; import { FieldMetadataType } from '~/generated-metadata/graphql'; export const calendarDayRecordIdsComponentFamilySelector = @@ -67,7 +63,7 @@ export const calendarDayRecordIdsComponentFamilySelector = const recordDateAsPlainDateInTimeZone = fieldMetadataItem.type === FieldMetadataType.DATE - ? parseToPlainDateOrThrow(recordDate) + ? Temporal.PlainDate.from(recordDate) : Temporal.Instant.from(recordDate) .toZonedDateTimeISO(timeZone) .toPlainDate(); diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx index 4b12b878977..08e824802c6 100644 --- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx @@ -21,7 +21,6 @@ import { Temporal } from 'temporal-polyfill'; import { type Nullable } from 'twenty-shared/types'; import { isDefined, - parseToPlainDateOrThrow, turnJSDateToPlainDate, type RelativeDateFilter, } from 'twenty-shared/utils'; @@ -357,7 +356,7 @@ export const DatePicker = ({ }: DatePickerProps) => { const { theme } = useContext(ThemeContext); const plainDate = isDefined(plainDateString) - ? parseToPlainDateOrThrow(plainDateString) + ? Temporal.PlainDate.from(plainDateString) : Temporal.Now.plainDateISO(); const { userTimezone } = useUserTimezone(); diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx index 7dcf4727756..fa13744512d 100644 --- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx @@ -15,11 +15,7 @@ import 'react-datepicker/dist/react-datepicker.css'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { Temporal } from 'temporal-polyfill'; import { type Nullable } from 'twenty-shared/types'; -import { - isDefined, - parseToPlainDateOrThrow, - turnJSDateToPlainDate, -} from 'twenty-shared/utils'; +import { isDefined, turnJSDateToPlainDate } from 'twenty-shared/utils'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; export const MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID = @@ -327,7 +323,7 @@ export const DatePickerWithoutCalendar = ({ onClose, }: DatePickerWithoutCalendarProps) => { const { theme } = useContext(ThemeContext); - const plainDate = isDefined(date) ? parseToPlainDateOrThrow(date) : null; + const plainDate = isDefined(date) ? Temporal.PlainDate.from(date) : null; const { closeDropdown: closeDropdownMonthSelect } = useCloseDropdown(); const { closeDropdown: closeDropdownYearSelect } = useCloseDropdown(); diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts index b61c494215f..b5e62c1b369 100644 --- a/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts +++ b/packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/utils/parse-microsoft-messages-import.util.ts @@ -36,23 +36,11 @@ export const parseMicrosoftMessagesImportError = ( } if (error.statusCode === 404) { - if ( - error.message?.includes( - 'The mailbox is either inactive, soft-deleted, or is hosted on-premise.', - ) - ) { - return new MessageImportDriverException( - `Disabled, deleted, inactive or no licence Microsoft account - code:${error.code}`, - MessageImportDriverExceptionCode.INSUFFICIENT_PERMISSIONS, - { cause: options?.cause }, - ); - } else { - return new MessageImportDriverException( - `Not found - code:${error.code}`, - MessageImportDriverExceptionCode.NOT_FOUND, - { cause: options?.cause }, - ); - } + return new MessageImportDriverException( + `Microsoft Graph API resource not found - code:${error.code} message:${error.message}`, + MessageImportDriverExceptionCode.INSUFFICIENT_PERMISSIONS, + { cause: options?.cause }, + ); } if (error.statusCode === 410) { 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 dc3fa1e16f9..b2064f01d3f 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 @@ -57,7 +57,6 @@ export class MessageImportExceptionHandlerService { switch (exception.code) { case MessageImportDriverExceptionCode.NOT_FOUND: await this.handleNotFoundException( - syncStep, messageChannel, workspaceId, ); @@ -245,35 +244,9 @@ export class MessageImportExceptionHandlerService { } private async handleNotFoundException( - syncStep: MessageImportSyncStep, messageChannel: Pick, workspaceId: string, ): Promise { - if (syncStep === MessageImportSyncStep.MESSAGE_LIST_FETCH) { - await this.messageChannelSyncStatusService.markAsFailed( - [messageChannel.id], - workspaceId, - MessageChannelSyncStatus.FAILED_UNKNOWN, - ); - - this.exceptionHandlerService.captureExceptions( - [ - new Error( - 'Not Found exception occurred while fetching message list, which should never happen', - ), - ], - { - additionalData: { - messageChannelId: messageChannel.id, - syncStep, - }, - workspace: { id: workspaceId }, - }, - ); - - return; - } - await this.messageChannelSyncStatusService.resetAndMarkAsMessagesListFetchPending( [messageChannel.id], workspaceId,