@@ -46,28 +46,39 @@ def test_update_function_room_account_data_limit(self) -> None:
4646
4747 # check we're testing what we think we are: no rows should yet have been
4848 # received
49- self .assertEqual ([], self .test_handler .received_rdata_rows )
49+ received_account_data_rows = [
50+ row
51+ for row in self .test_handler .received_rdata_rows
52+ if row [0 ] == AccountDataStream .NAME
53+ ]
54+ self .assertEqual ([], received_account_data_rows )
5055
5156 # now reconnect to pull the updates
5257 self .reconnect ()
5358 self .replicate ()
5459
55- # we should have received all the expected rows in the right order
56- received_rows = self .test_handler .received_rdata_rows
60+ # We should have received all the expected rows in the right order
61+ #
62+ # Filter the updates to only include account data changes
63+ received_account_data_rows = [
64+ row
65+ for row in self .test_handler .received_rdata_rows
66+ if row [0 ] == AccountDataStream .NAME
67+ ]
5768
5869 for t in updates :
59- (stream_name , token , row ) = received_rows .pop (0 )
70+ (stream_name , token , row ) = received_account_data_rows .pop (0 )
6071 self .assertEqual (stream_name , AccountDataStream .NAME )
6172 self .assertIsInstance (row , AccountDataStream .AccountDataStreamRow )
6273 self .assertEqual (row .data_type , t )
6374 self .assertEqual (row .room_id , "test_room" )
6475
65- (stream_name , token , row ) = received_rows .pop (0 )
76+ (stream_name , token , row ) = received_account_data_rows .pop (0 )
6677 self .assertIsInstance (row , AccountDataStream .AccountDataStreamRow )
6778 self .assertEqual (row .data_type , "m.global" )
6879 self .assertIsNone (row .room_id )
6980
70- self .assertEqual ([], received_rows )
81+ self .assertEqual ([], received_account_data_rows )
7182
7283 def test_update_function_global_account_data_limit (self ) -> None :
7384 """Test replication with many global account data updates"""
@@ -85,32 +96,38 @@ def test_update_function_global_account_data_limit(self) -> None:
8596 store .add_account_data_to_room ("test_user" , "test_room" , "m.per_room" , {})
8697 )
8798
88- # tell the notifier to catch up to avoid duplicate rows.
89- # workaround for https://github.com/matrix-org/synapse/issues/7360
90- # FIXME remove this when the above is fixed
91- self .replicate ()
92-
9399 # check we're testing what we think we are: no rows should yet have been
94100 # received
95- self .assertEqual ([], self .test_handler .received_rdata_rows )
101+ received_account_data_rows = [
102+ row
103+ for row in self .test_handler .received_rdata_rows
104+ if row [0 ] == AccountDataStream .NAME
105+ ]
106+ self .assertEqual ([], received_account_data_rows )
96107
97108 # now reconnect to pull the updates
98109 self .reconnect ()
99110 self .replicate ()
100111
101112 # we should have received all the expected rows in the right order
102- received_rows = self .test_handler .received_rdata_rows
113+ #
114+ # Filter the updates to only include typing changes
115+ received_account_data_rows = [
116+ row
117+ for row in self .test_handler .received_rdata_rows
118+ if row [0 ] == AccountDataStream .NAME
119+ ]
103120
104121 for t in updates :
105- (stream_name , token , row ) = received_rows .pop (0 )
122+ (stream_name , token , row ) = received_account_data_rows .pop (0 )
106123 self .assertEqual (stream_name , AccountDataStream .NAME )
107124 self .assertIsInstance (row , AccountDataStream .AccountDataStreamRow )
108125 self .assertEqual (row .data_type , t )
109126 self .assertIsNone (row .room_id )
110127
111- (stream_name , token , row ) = received_rows .pop (0 )
128+ (stream_name , token , row ) = received_account_data_rows .pop (0 )
112129 self .assertIsInstance (row , AccountDataStream .AccountDataStreamRow )
113130 self .assertEqual (row .data_type , "m.per_room" )
114131 self .assertEqual (row .room_id , "test_room" )
115132
116- self .assertEqual ([], received_rows )
133+ self .assertEqual ([], received_account_data_rows )
0 commit comments