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

This will only happen when a server has multiple out of band membership
events in a single room.
code_spécifique_watcha
Erik Johnston 3 years ago committed by GitHub
parent 00640ee71a
commit f58d202e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/10743.bugfix
  2. 8
      synapse/storage/databases/main/events.py

@ -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).

@ -575,7 +575,13 @@ class PersistEventsStore:
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:

Loading…
Cancel
Save