Skip to content

feat: Add CardDAV/VTODO integration tests and fix Nextcloud addressbo… - #29

Merged
PhilflowIO merged 8 commits into
masterfrom
feature/dav-migration-cli
Nov 6, 2025
Merged

feat: Add CardDAV/VTODO integration tests and fix Nextcloud addressbo…#29
PhilflowIO merged 8 commits into
masterfrom
feature/dav-migration-cli

Conversation

@PhilflowIO

Copy link
Copy Markdown
Owner

…ok bugs

Implements comprehensive test coverage for issue #27 (CardDAV and VTODO migration) and fixes critical bugs preventing Nextcloud addressbook operations.

Production validation: Successfully migrated 131 contacts from Radicale to Nextcloud.

Bug Fixes (AddressBookCollectionMigrator):

  • Fix addressbook home URL construction for Nextcloud provider

    • Now correctly uses /remote.php/dav/addressbooks/users/{username}/
    • Added provider-specific URL logic (Nextcloud, generic CardDAV)
    • Fallback handling with warnings for unknown providers
  • Add required resourcetype property to addressbook creation

    • Includes both d:collection and carddav:addressbook types
    • Complies with RFC 5689 (Extended MKCOL for WebDAV)
  • Implement homeUrl override for fetchAddressBooks

    • Ensures addressbooks are discovered at correct CardDAV endpoints
    • Properly restores original homeUrl after operations
    • Works for both source and target servers

New Test Files:

  • tests/integration/contacts.integration.test.ts (5 tests)

    • Full migration (15 contacts)
    • Multi-addressbook (3 addressbooks, 18 contacts)
    • DSGVO compliance verification
    • State persistence
    • Empty addressbook handling
  • tests/integration/vtodo.integration.test.ts (6 tests)

    • Task-only calendar (10 tasks)
    • Mixed calendar (5 events + 3 tasks)
    • Multiple calendars (events/tasks/mixed)
    • Object type detection (VEVENT vs VTODO)
    • Empty calendar handling
    • Large task collection (50 tasks)

Code Coverage:

  • CalendarCollectionMigrator: 86.45% (exceeds 80% target)
  • AddressBookCollectionMigrator: 74.6% (core logic fully covered)

Dependencies:

  • Added cross-fetch for fetch polyfill
  • Updated tsdav to ^2.1.6 for makeAddressBook support

Test Results:

  • 11 new integration tests (all passing)
  • DSGVO compliance verified (zero contact data in state files)
  • Production validated (131 contacts successfully migrated)

Closes #27

…ok bugs

Implements comprehensive test coverage for issue #27 (CardDAV and VTODO migration)
and fixes critical bugs preventing Nextcloud addressbook operations.

Production validation: Successfully migrated 131 contacts from Radicale to Nextcloud.

Bug Fixes (AddressBookCollectionMigrator):
- Fix addressbook home URL construction for Nextcloud provider
  * Now correctly uses /remote.php/dav/addressbooks/users/{username}/
  * Added provider-specific URL logic (Nextcloud, generic CardDAV)
  * Fallback handling with warnings for unknown providers

- Add required resourcetype property to addressbook creation
  * Includes both d:collection and carddav:addressbook types
  * Complies with RFC 5689 (Extended MKCOL for WebDAV)

- Implement homeUrl override for fetchAddressBooks
  * Ensures addressbooks are discovered at correct CardDAV endpoints
  * Properly restores original homeUrl after operations
  * Works for both source and target servers

New Test Files:
- tests/integration/contacts.integration.test.ts (5 tests)
  * Full migration (15 contacts)
  * Multi-addressbook (3 addressbooks, 18 contacts)
  * DSGVO compliance verification
  * State persistence
  * Empty addressbook handling

- tests/integration/vtodo.integration.test.ts (6 tests)
  * Task-only calendar (10 tasks)
  * Mixed calendar (5 events + 3 tasks)
  * Multiple calendars (events/tasks/mixed)
  * Object type detection (VEVENT vs VTODO)
  * Empty calendar handling
  * Large task collection (50 tasks)

Code Coverage:
- CalendarCollectionMigrator: 86.45% (exceeds 80% target)
- AddressBookCollectionMigrator: 74.6% (core logic fully covered)

Dependencies:
- Added cross-fetch for fetch polyfill
- Updated tsdav to ^2.1.6 for makeAddressBook support

Test Results:
- 11 new integration tests (all passing)
- DSGVO compliance verified (zero contact data in state files)
- Production validated (131 contacts successfully migrated)

Closes #27
PhilflowIO added a commit that referenced this pull request Nov 6, 2025
Fixes GitHub Actions CI failures by:
- Installing pnpm before use (was missing, causing "command not found")
- Updating Node versions from 10,12,14,16 to 18,20,22 (modern LTS versions)
- Updating release workflow from Node 16 to Node 20
- Fixing pnpm install command syntax

This resolves the CI failures preventing PR #29 from being merged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixes GitHub Actions CI failures by:
- Installing pnpm before use (was missing, causing "command not found")
- Updating Node versions from 10,12,14,16 to 18,20,22 (modern LTS versions)
- Updating release workflow from Node 16 to Node 20
- Fixing pnpm install command syntax

This resolves the CI failures preventing PR #29 from being merged.
@PhilflowIO
PhilflowIO force-pushed the feature/dav-migration-cli branch from 4fb707d to 56cf586 Compare November 6, 2025 09:14
Resolve version conflict in package.json (keep 2.3.0 for new features)
@PhilflowIO
PhilflowIO merged commit 9937a73 into master Nov 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration tests for CardDAV and VTODO migration

1 participant