Skip to content

Local cache of calendar objects #8

Description

@SashankBhamidi

The cache stores the last-known server state of each object. Without it, conflict detection can't tell whether a local change happened.

src/calendaring_sync/cache.py:

  • CachedObject dataclass: key, content, etag_or_state, cached_at
  • ObjectCache:
    • get(key) -> CachedObject | None
    • put(key, content, etag_or_state)
    • delete(key)
    • all() -> iterator of CachedObject

Uses the same StorageBackend abstraction as StateStore. Can share the same SQLite database, different table.

Storing raw iCalendar means the diff is always available without re-fetching. The conflict detector compares local current content against cached server content to classify changes.

Tests: put then get round-trips exactly (no encoding loss). delete removes it. all() iterates all entries. Missing key returns None, not raise.

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