diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2022-08-04 11:02:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 11:02:29 +0200 |
commit | 845732be450b3f9c991df35b2f07d600a0eca6dd (patch) | |
tree | 21f1f3d15f3196318bc01a4cbda4a6cf580a646d /tests/rest | |
parent | Add some tracing spans to give insight into local joins (#13439) (diff) | |
download | synapse-845732be450b3f9c991df35b2f07d600a0eca6dd.tar.xz |
Fix rooms not being properly excluded from incremental sync (#13408)
Diffstat (limited to 'tests/rest')
-rw-r--r-- | tests/rest/client/test_sync.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/rest/client/test_sync.py b/tests/rest/client/test_sync.py index b085c50356..ae16184828 100644 --- a/tests/rest/client/test_sync.py +++ b/tests/rest/client/test_sync.py @@ -948,3 +948,24 @@ class ExcludeRoomTestCase(unittest.HomeserverTestCase): self.assertNotIn(self.excluded_room_id, channel.json_body["rooms"]["invite"]) self.assertIn(self.included_room_id, channel.json_body["rooms"]["invite"]) + + def test_incremental_sync(self) -> None: + """Tests that activity in the room is properly filtered out of incremental + syncs. + """ + channel = self.make_request("GET", "/sync", access_token=self.tok) + self.assertEqual(channel.code, 200, channel.result) + next_batch = channel.json_body["next_batch"] + + self.helper.send(self.excluded_room_id, tok=self.tok) + self.helper.send(self.included_room_id, tok=self.tok) + + channel = self.make_request( + "GET", + f"/sync?since={next_batch}", + access_token=self.tok, + ) + self.assertEqual(channel.code, 200, channel.result) + + self.assertNotIn(self.excluded_room_id, channel.json_body["rooms"]["join"]) + self.assertIn(self.included_room_id, channel.json_body["rooms"]["join"]) |