Skip to content

CalDAV adapter #10

Description

@SashankBhamidi

src/calendaring_sync/adapters/caldav.py:

CalDAVAdapter(calendar, state_store, cache)
    .sync(resolver_fn=None) -> SyncResult
    .push(url, ical_content)
    .delete(url)

SyncResult: lists of applied, conflicted, and failed changes.

Calls python-caldav's calendar.sync() to get changed objects since the last sync-token. Feeds each change through the state store and conflict detector. Updates the cache after a successful sync.

Optional dependency: python-caldav>=3.0. If not installed, importing this module raises ImportError with a clear message pointing to the install extra.

Unit tests mock python-caldav's sync() response. Integration test uses Radicale (embedded, no Docker needed).

Scenarios to cover:

  • First sync populates cache
  • Second sync with server-side change classifies as REMOTE_ONLY
  • Local change classifies as LOCAL_ONLY
  • Conflict surfaces as ConflictError, not dropped silently

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions