summary refs log tree commit diff
path: root/tests/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-12-02 15:22:37 +0000
committerGitHub <noreply@github.com>2020-12-02 15:22:37 +0000
commitc5b6abd53d1549c7a7cc30c644dd8921bfc10ea2 (patch)
tree91db5d4531d4d67d94b810530de24540d06f7ec8 /tests/storage
parentAdd missing prometheus rules for persisted events (#8802) (diff)
downloadsynapse-c5b6abd53d1549c7a7cc30c644dd8921bfc10ea2.tar.xz
Correctly handle unpersisted events when calculating auth chain difference. (#8827)
We do state res with unpersisted events when calculating the new current state of the room, so that should be the only thing impacted. I don't think this is tooooo big of a deal as:

1. the next time a state event happens in the room the current state should correct itself;
2. in the common case all the unpersisted events' auth events will be pulled in by other state, so will still return the correct result (or one which is sufficiently close to not affect the result); and
3. we mostly use the state at an event to do important operations, which isn't affected by this.
Diffstat (limited to 'tests/storage')
-rw-r--r--tests/storage/test_event_federation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/storage/test_event_federation.py b/tests/storage/test_event_federation.py
index d4c3b867e3..71c21d8c75 100644
--- a/tests/storage/test_event_federation.py
+++ b/tests/storage/test_event_federation.py
@@ -217,6 +217,11 @@ class EventFederationWorkerStoreTestCase(tests.unittest.HomeserverTestCase):
         self.assertSetEqual(difference, {"a", "b", "c"})
 
         difference = self.get_success(
+            self.store.get_auth_chain_difference([{"a", "c"}, {"b", "c"}])
+        )
+        self.assertSetEqual(difference, {"a", "b"})
+
+        difference = self.get_success(
             self.store.get_auth_chain_difference([{"a"}, {"b"}, {"d"}])
         )
         self.assertSetEqual(difference, {"a", "b", "d", "e"})