mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 16:55:20 -04:00
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:
parent
dc901a885f
commit
ba79fb4a61
13 changed files with 43 additions and 58 deletions
|
@ -18,7 +18,6 @@ from http import HTTPStatus
|
|||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
Collection,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
|
@ -45,6 +44,7 @@ from synapse.metrics.background_process_metrics import (
|
|||
)
|
||||
from synapse.types import (
|
||||
JsonDict,
|
||||
StrCollection,
|
||||
StreamKeyType,
|
||||
StreamToken,
|
||||
UserID,
|
||||
|
@ -146,7 +146,7 @@ class DeviceWorkerHandler:
|
|||
|
||||
@cancellable
|
||||
async def get_device_changes_in_shared_rooms(
|
||||
self, user_id: str, room_ids: Collection[str], from_token: StreamToken
|
||||
self, user_id: str, room_ids: StrCollection, from_token: StreamToken
|
||||
) -> Set[str]:
|
||||
"""Get the set of users whose devices have changed who share a room with
|
||||
the given user.
|
||||
|
@ -551,7 +551,7 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
@trace
|
||||
@measure_func("notify_device_update")
|
||||
async def notify_device_update(
|
||||
self, user_id: str, device_ids: Collection[str]
|
||||
self, user_id: str, device_ids: StrCollection
|
||||
) -> None:
|
||||
"""Notify that a user's device(s) has changed. Pokes the notifier, and
|
||||
remote servers if the user is local.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue