diff --git a/lib/services/caldav-sync.ts b/lib/services/caldav-sync.ts index 3f3a8b7..7af7a70 100644 --- a/lib/services/caldav-sync.ts +++ b/lib/services/caldav-sync.ts @@ -51,7 +51,10 @@ export async function discoverInfomaniakCalendars( // List all calendars using PROPFIND on root logger.debug('[CALDAV] Fetching directory contents from root'); - const items = await client.getDirectoryContents('/'); + const itemsResult = await client.getDirectoryContents('/'); + + // Handle both FileStat[] and ResponseDataDetailed return types + const items = Array.isArray(itemsResult) ? itemsResult : itemsResult.data; logger.debug('[CALDAV] Found items in root directory', { count: items.length,