IMAP Fixes & Improvements (#13582)

- Removed caching of IMAP client as it was problematic and didn't really
matter because of our pipeline, also added retry logic to client.
- Some code refactoring and cleanup
- Breaking changes:
   - Removed messageChannel.syncCursor
   - Uses messageFolder.syncCursor instead
- Removed Date based sync cursor in favor of message UID which is much
more reliable and precise

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
neo773
2025-08-05 13:16:28 +05:30
committed by GitHub
parent ca6322cae6
commit 9ceb097ab7
8 changed files with 246 additions and 220 deletions
@@ -20,6 +20,7 @@ import {
connectionImapSmtpCalDav,
isProtocolConfigured,
} from '@/settings/accounts/validation-schemas/connectionImapSmtpCalDav';
import { ApolloError } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
ConnectedImapSmtpCaldavAccount,
@@ -149,12 +150,9 @@ export const useImapSmtpCaldavConnectionForm = ({
enqueueSuccessSnackBar({ message: successMessage });
navigate(SettingsPath.Accounts);
} catch (error) {
const errorMessage =
error instanceof Error
? error.message
: 'An unexpected error occurred';
enqueueErrorSnackBar({ message: errorMessage });
enqueueErrorSnackBar({
apolloError: error instanceof ApolloError ? error : undefined,
});
}
},
[