Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Properly update the threads table when thread events are redacted #14248

Merged
merged 11 commits into from
Oct 21, 2022
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,9 @@ def _handle_redact_relations(
txn.execute(sql, (redacted_relates_to, RelationTypes.THREAD))

row = txn.fetchone()
# If a new latest event is found, update the threads table.
# If a latest event is found, update the threads table, this might
# be the same current latest event (if an earlier event in the thread
# was redacted).
clokep marked this conversation as resolved.
Show resolved Hide resolved
if row:
self.db_pool.simple_upsert_txn(
txn,
Expand Down