mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-01 09:34:23 -04:00
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.
This commit is contained in:
parent
0fed46ebe5
commit
c5b6abd53d
4 changed files with 216 additions and 5 deletions
|
@ -216,6 +216,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"}])
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue