Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix incorrect type hint in filtering code. (#12695)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored May 10, 2022
1 parent 989fa33 commit 29f0670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/12695.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes an incorrect type hint for `Filter._check_event_relations`.
5 changes: 3 additions & 2 deletions synapse/api/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
TYPE_CHECKING,
Awaitable,
Callable,
Collection,
Dict,
Iterable,
List,
Expand Down Expand Up @@ -444,9 +445,9 @@ def filter_rooms(self, room_ids: Iterable[str]) -> Set[str]:
return room_ids

async def _check_event_relations(
self, events: Iterable[FilterEvent]
self, events: Collection[FilterEvent]
) -> List[FilterEvent]:
# The event IDs to check, mypy doesn't understand the ifinstance check.
# The event IDs to check, mypy doesn't understand the isinstance check.
event_ids = [event.event_id for event in events if isinstance(event, EventBase)] # type: ignore[attr-defined]
event_ids_to_keep = set(
await self._store.events_have_relations(
Expand Down

0 comments on commit 29f0670

Please sign in to comment.