mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:24:54 -04:00
Fix sync bug when accepting invites (#4956)
Hopefully this time we really will fix #4422. We need to make sure that the cache on `get_rooms_for_user_with_stream_ordering` is invalidated *before* the SyncHandler is notified for the new events, and we can now do so reliably via the `events` stream.
This commit is contained in:
parent
4c552ed78a
commit
297bf2547e
7 changed files with 237 additions and 69 deletions
|
@ -56,7 +56,9 @@ class BaseSlavedStoreTestCase(unittest.HomeserverTestCase):
|
|||
client = client_factory.buildProtocol(None)
|
||||
|
||||
client.makeConnection(FakeTransport(server, reactor))
|
||||
server.makeConnection(FakeTransport(client, reactor))
|
||||
|
||||
self.server_to_client_transport = FakeTransport(client, reactor)
|
||||
server.makeConnection(self.server_to_client_transport)
|
||||
|
||||
def replicate(self):
|
||||
"""Tell the master side of replication that something has happened, and then
|
||||
|
@ -69,6 +71,24 @@ class BaseSlavedStoreTestCase(unittest.HomeserverTestCase):
|
|||
master_result = self.get_success(getattr(self.master_store, method)(*args))
|
||||
slaved_result = self.get_success(getattr(self.slaved_store, method)(*args))
|
||||
if expected_result is not None:
|
||||
self.assertEqual(master_result, expected_result)
|
||||
self.assertEqual(slaved_result, expected_result)
|
||||
self.assertEqual(master_result, slaved_result)
|
||||
self.assertEqual(
|
||||
master_result,
|
||||
expected_result,
|
||||
"Expected master result to be %r but was %r" % (
|
||||
expected_result, master_result
|
||||
),
|
||||
)
|
||||
self.assertEqual(
|
||||
slaved_result,
|
||||
expected_result,
|
||||
"Expected slave result to be %r but was %r" % (
|
||||
expected_result, slaved_result
|
||||
),
|
||||
)
|
||||
self.assertEqual(
|
||||
master_result,
|
||||
slaved_result,
|
||||
"Slave result %r does not match master result %r" % (
|
||||
slaved_result, master_result
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue