diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-09-20 07:48:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 07:48:55 -0400 |
commit | 7ec0a141b4bdda0fa67cb1f2af7f321b9963f0b8 (patch) | |
tree | 8a500d3fce31d337d50d43c75df70d243371acb2 /synapse/handlers | |
parent | Return immutable objects for cachedList decorators (#16350) (diff) | |
download | synapse-7ec0a141b4bdda0fa67cb1f2af7f321b9963f0b8.tar.xz |
Convert more cached return values to immutable types (#16356)
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/federation_event.py | 2 | ||||
-rw-r--r-- | synapse/handlers/relations.py | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py index eedde97ab0..7c62cdfaef 100644 --- a/synapse/handlers/federation_event.py +++ b/synapse/handlers/federation_event.py @@ -1538,7 +1538,7 @@ class FederationEventHandler: logger.exception("Failed to resync device for %s", sender) async def backfill_event_id( - self, destinations: List[str], room_id: str, event_id: str + self, destinations: StrCollection, room_id: str, event_id: str ) -> PulledPduInfo: """Backfill a single event and persist it as a non-outlier which means we also pull in all of the state and auth events necessary for it. diff --git a/synapse/handlers/relations.py b/synapse/handlers/relations.py index db97f7aede..9b13448cdd 100644 --- a/synapse/handlers/relations.py +++ b/synapse/handlers/relations.py @@ -13,7 +13,17 @@ # limitations under the License. import enum import logging -from typing import TYPE_CHECKING, Collection, Dict, FrozenSet, Iterable, List, Optional +from typing import ( + TYPE_CHECKING, + Collection, + Dict, + FrozenSet, + Iterable, + List, + Mapping, + Optional, + Sequence, +) import attr @@ -245,7 +255,7 @@ class RelationsHandler: async def get_references_for_events( self, event_ids: Collection[str], ignored_users: FrozenSet[str] = frozenset() - ) -> Dict[str, List[_RelatedEvent]]: + ) -> Mapping[str, Sequence[_RelatedEvent]]: """Get a list of references to the given events. Args: |