|
51 | 51 | ProfileInfo, |
52 | 52 | RoomsForUser, |
53 | 53 | ) |
54 | | -from synapse.types import JsonDict, PersistedEventPosition, StateMap, get_domain_from_id |
| 54 | +from synapse.types import PersistedEventPosition, StateMap, get_domain_from_id |
55 | 55 | from synapse.util.async_helpers import Linearizer |
56 | 56 | from synapse.util.caches import intern_string |
57 | 57 | from synapse.util.caches.descriptors import _CacheContext, cached, cachedList |
@@ -189,9 +189,7 @@ async def get_users_in_room(self, room_id: str) -> List[str]: |
189 | 189 | "get_users_in_room", self.get_users_in_room_txn, room_id |
190 | 190 | ) |
191 | 191 |
|
192 | | - def get_users_in_room_txn( |
193 | | - self, txn: LoggingTransaction, room_id: str |
194 | | - ) -> List[str]: |
| 192 | + def get_users_in_room_txn(self, txn: LoggingTransaction, room_id: str) -> List[str]: |
195 | 193 | # If we can assume current_state_events.membership is up to date |
196 | 194 | # then we can avoid a join, which is a Very Good Thing given how |
197 | 195 | # frequently this function gets called. |
@@ -232,7 +230,7 @@ async def get_users_in_room_with_profiles( |
232 | 230 | """ |
233 | 231 |
|
234 | 232 | def _get_users_in_room_with_profiles( |
235 | | - txn: LoggingTransaction |
| 233 | + txn: LoggingTransaction, |
236 | 234 | ) -> Dict[str, ProfileInfo]: |
237 | 235 | sql = """ |
238 | 236 | SELECT state_key, display_name, avatar_url FROM room_memberships as m |
@@ -696,6 +694,7 @@ async def get_joined_users_from_state( |
696 | 694 | # To do this we set the state_group to a new object as object() != object() |
697 | 695 | state_group = object() |
698 | 696 |
|
| 697 | + assert state_group is not None |
699 | 698 | with Measure(self._clock, "get_joined_users_from_state"): |
700 | 699 | return await self._get_joined_users_from_context( |
701 | 700 | room_id, state_group, state_entry.state, context=state_entry |
@@ -876,6 +875,7 @@ async def get_joined_hosts( |
876 | 875 | # To do this we set the state_group to a new object as object() != object() |
877 | 876 | state_group = object() |
878 | 877 |
|
| 878 | + assert state_group is not None |
879 | 879 | with Measure(self._clock, "get_joined_hosts"): |
880 | 880 | return await self._get_joined_hosts( |
881 | 881 | room_id, state_group, state_entry=state_entry |
@@ -1271,9 +1271,9 @@ def _background_current_state_membership_txn( |
1271 | 1271 |
|
1272 | 1272 |
|
1273 | 1273 | class RoomMemberStore( |
1274 | | - RoomMemberWorkerStore, |
1275 | | - RoomMemberBackgroundUpdateStore, |
1276 | | - CacheInvalidationWorkerStore, |
| 1274 | + RoomMemberWorkerStore, |
| 1275 | + RoomMemberBackgroundUpdateStore, |
| 1276 | + CacheInvalidationWorkerStore, |
1277 | 1277 | ): |
1278 | 1278 | def __init__( |
1279 | 1279 | self, |
|
0 commit comments