Use StrCollection in place of Collection[str] in (most) handlers code. (#14922)

Due to the increased safety of StrCollection over Collection[str]
and Sequence[str].
This commit is contained in:
Patrick Cloke 2023-01-26 12:31:58 -05:00 committed by GitHub
parent dc901a885f
commit ba79fb4a61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 43 additions and 58 deletions

View file

@ -80,6 +80,7 @@ from synapse.types import (
PersistedEventPosition,
RoomStreamToken,
StateMap,
StrCollection,
UserID,
get_domain_from_id,
)
@ -615,7 +616,7 @@ class FederationEventHandler:
@trace
async def backfill(
self, dest: str, room_id: str, limit: int, extremities: Collection[str]
self, dest: str, room_id: str, limit: int, extremities: StrCollection
) -> None:
"""Trigger a backfill request to `dest` for the given `room_id`
@ -1565,7 +1566,7 @@ class FederationEventHandler:
@trace
@tag_args
async def _get_events_and_persist(
self, destination: str, room_id: str, event_ids: Collection[str]
self, destination: str, room_id: str, event_ids: StrCollection
) -> None:
"""Fetch the given events from a server, and persist them as outliers.