0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 18:43:53 +01:00

Fix incorrect type hint in filtering code. (#12695)

This commit is contained in:
Patrick Cloke 2022-05-10 14:10:22 -04:00 committed by GitHub
parent 989fa33096
commit 29f06704b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

1
changelog.d/12695.misc Normal file
View file

@ -0,0 +1 @@
Fixes an incorrect type hint for `Filter._check_event_relations`.

View file

@ -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(