mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-17 23:42:33 +01:00
Fix incorrect type hint in filtering code. (#12695)
This commit is contained in:
parent
989fa33096
commit
29f06704b8
2 changed files with 4 additions and 2 deletions
1
changelog.d/12695.misc
Normal file
1
changelog.d/12695.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Fixes an incorrect type hint for `Filter._check_event_relations`.
|
|
@ -19,6 +19,7 @@ from typing import (
|
|||
TYPE_CHECKING,
|
||||
Awaitable,
|
||||
Callable,
|
||||
Collection,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
|
@ -444,9 +445,9 @@ class Filter:
|
|||
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(
|
||||
|
|
Loading…
Reference in a new issue