summary refs log tree commit diff
path: root/tests/storage/test_event_chain.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-06-24 15:40:28 +0100
committerGitHub <noreply@github.com>2024-06-24 14:40:28 +0000
commit930a64b6c1a4fe096d541bf9c5f0279fb636ed16 (patch)
tree083aad3888cdf294f68103b95d8070f31e1cffbf /tests/storage/test_event_chain.py
parentAdd support for MSC3823 - Account Suspension Part 2 (#17255) (diff)
downloadsynapse-930a64b6c1a4fe096d541bf9c5f0279fb636ed16.tar.xz
Reintroduce #17291. (#17338)
This is #17291 (which got reverted), with some added fixups, and change
so that tests actually pick up the error.

The problem was that we were not calculating any new chain IDs due to a
missing `not` in a condition.
Diffstat (limited to 'tests/storage/test_event_chain.py')
-rw-r--r--tests/storage/test_event_chain.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/storage/test_event_chain.py b/tests/storage/test_event_chain.py
index 81feb3ec29..c4e216c308 100644
--- a/tests/storage/test_event_chain.py
+++ b/tests/storage/test_event_chain.py
@@ -447,7 +447,14 @@ class EventChainStoreTestCase(HomeserverTestCase):
             )
 
             # Actually call the function that calculates the auth chain stuff.
-            persist_events_store._persist_event_auth_chain_txn(txn, events)
+            new_event_links = (
+                persist_events_store.calculate_chain_cover_index_for_events_txn(
+                    txn, events[0].room_id, [e for e in events if e.is_state()]
+                )
+            )
+            persist_events_store._persist_event_auth_chain_txn(
+                txn, events, new_event_links
+            )
 
         self.get_success(
             persist_events_store.db_pool.runInteraction(