CalDav throw error If a user tries to connect an unsupported server. (#17363)

Legacy CalDav servers don't support `syncCollection` which is required
to store a `syncCursor` this PR updates the code to let user know we
don't support their server.

Source:
https://github.com/natelindev/tsdav/blob/main/src/collection.ts#L193-L194
This commit is contained in:
neo773
2026-01-22 22:42:00 +05:30
committed by GitHub
parent 3ce33304a3
commit 843fda7564
2 changed files with 34 additions and 0 deletions
@@ -128,11 +128,19 @@ export class ImapSmtpCaldavService {
try {
await client.listCalendars();
await client.validateSyncCollectionSupport();
} catch (error) {
this.logger.error(
`CALDAV connection failed: ${error.message}`,
error.stack,
);
if (error.message?.includes('CALDAV_SYNC_COLLECTION_NOT_SUPPORTED')) {
throw new UserInputError(`CALDAV connection failed: ${error.message}`, {
userFriendlyMessage: msg`Your CalDAV server does not support incremental sync (RFC 6578). Please use a compatible provider such as Nextcloud, iCloud, or Fastmail.`,
});
}
if (error.code === 'FailedToOpenSocket') {
throw new UserInputError(`CALDAV connection failed: ${error.message}`, {
userFriendlyMessage: msg`We couldn't connect to your CalDAV server. Please check your server settings and try again.`,