Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Sep 12, 2023
1 parent 5bee02f commit 15293d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions synapse/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
from synapse.http.types import QueryParams
from synapse.logging.context import make_deferred_yieldable, run_in_background
from synapse.logging.opentracing import set_tag, start_active_span, tags
from synapse.types import BytesSequence, ISynapseReactor, StrSequence
from synapse.types import ISynapseReactor, StrSequence
from synapse.util import json_decoder
from synapse.util.async_helpers import timeout_deferred

Expand Down Expand Up @@ -108,9 +108,10 @@
# the value actually has to be a List, but List is invariant so we can't specify that
# the entries can either be Lists or bytes.
RawHeaderValue = Union[
BytesSequence,
StrSequence,
List[bytes],
List[Union[str, bytes]],
Tuple[bytes, ...],
Tuple[Union[str, bytes], ...],
]

Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from synapse.storage.databases.main.events_worker import EventsWorkerStore
from synapse.storage.databases.main.signatures import SignatureWorkerStore
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
from synapse.types import JsonDict, StrCollection
from synapse.types import JsonDict, StrCollection, StrSequence
from synapse.util import json_encoder
from synapse.util.caches.descriptors import cached
from synapse.util.caches.lrucache import LruCache
Expand Down Expand Up @@ -1179,7 +1179,7 @@ def _get_rooms_with_many_extremities_txn(txn: LoggingTransaction) -> List[str]:
)

@cached(max_entries=5000, iterable=True)
async def get_latest_event_ids_in_room(self, room_id: str) -> List[str]:
async def get_latest_event_ids_in_room(self, room_id: str) -> StrSequence:
return await self.db_pool.simple_select_onecol(
table="event_forward_extremities",
keyvalues={"room_id": room_id},
Expand Down
1 change: 0 additions & 1 deletion synapse/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
#
# Unlike StrCollection, StrSequence is an ordered collection of strings.
StrSequence = Union[Tuple[str, ...], List[str]]
BytesSequence = Union[Tuple[bytes, ...], List[bytes]]


# Note that this seems to require inheriting *directly* from Interface in order
Expand Down

0 comments on commit 15293d4

Please sign in to comment.