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.
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:CachedObjectdataclass: key, content, etag_or_state, cached_atObjectCache:get(key) -> CachedObject | Noneput(key, content, etag_or_state)delete(key)all() -> iterator of CachedObjectUses the same
StorageBackendabstraction asStateStore. 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.