mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-11 12:17:54 +00:00
Preparation for making the Rust event cache the one `EventsWorkerStore` reads through. - `Cache::new_indexed` keeps the keys grouped by a value-derived index key, maintained on every insert and removal path, and `invalidate_index` drops one group. A room purge invalidates the event cache by room, and retention runs that for every room with a policy, so it must not walk the whole cache. - `Cache::touch` marks an entry as read without cloning it, `get_or_count_miss` and `get_uncounted` cover the metrics cases of Python's `update_metrics`, and `count_miss` records a miss found elsewhere. - `CachedEvent` works out its auth event IDs on first use. An event filled from Python is usually never read by state resolution, so it should not pay to parse them. `auth_event_ids` is fallible now, and its callers in state resolution propagate the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VpBQxvqZTUvHCMm3u6CR7J