Invalidate caches when an event with a relation is redacted. (#12121)

The caches for the target of the relation must be cleared
so that the bundled aggregations are re-calculated after
the redaction is processed.
This commit is contained in:
Patrick Cloke 2022-03-07 09:00:05 -05:00 committed by GitHub
parent 0211f18d65
commit f63bedef07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 205 additions and 51 deletions

View file

@ -200,6 +200,8 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
self.get_relations_for_event.invalidate((relates_to,))
self.get_aggregation_groups_for_event.invalidate((relates_to,))
self.get_applicable_edit.invalidate((relates_to,))
self.get_thread_summary.invalidate((relates_to,))
self.get_thread_participated.invalidate((relates_to,))
async def invalidate_cache_and_stream(self, cache_name: str, keys: Tuple[Any, ...]):
"""Invalidates the cache and adds it to the cache stream so slaves