Correctly update aggregation counts after redaction

This commit is contained in:
Erik Johnston 2019-05-20 10:13:05 +01:00
parent d4ca533d70
commit 935af0da38
3 changed files with 57 additions and 0 deletions

View file

@ -415,3 +415,20 @@ class RelationsStore(RelationsWorkerStore):
if rel_type == RelationTypes.REPLACES:
txn.call_after(self.get_applicable_edit.invalidate, (parent_id,))
def _handle_redaction(self, txn, redacted_event_id):
"""Handles receiving a redaction and checking whether we need to remove
any redacted relations from the database.
Args:
txn
redacted_event_id (str): The event that was redacted.
"""
self._simple_delete_txn(
txn,
table="event_relations",
keyvalues={
"event_id": redacted_event_id,
}
)