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

Fix bug with reusing 'txn' when persisting event. #10743

Merged
merged 3 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10743.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix edge case when persisting events into a room where there are multiple events we previously hadn't calculated auth chains for (and hadn't marked as needing to be calculated).
8 changes: 7 additions & 1 deletion synapse/storage/databases/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,13 @@ def _add_chain_cover_index(

missing_auth_chains.clear()

for auth_id, event_type, state_key, chain_id, sequence_number in txn:
for (
auth_id,
event_type,
state_key,
chain_id,
sequence_number,
) in txn.fetchall():
event_to_types[auth_id] = (event_type, state_key)

if chain_id is None:
Expand Down