mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 18:34:56 -04:00
Fix typing for SyncHandler (#8237)
This commit is contained in:
parent
6f6f371a87
commit
5bfc79486d
4 changed files with 13 additions and 10 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
import itertools
|
||||
import logging
|
||||
from typing import Any, Dict, FrozenSet, List, Optional, Set, Tuple
|
||||
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, List, Optional, Set, Tuple
|
||||
|
||||
import attr
|
||||
from prometheus_client import Counter
|
||||
|
@ -44,6 +44,9 @@ from synapse.util.caches.response_cache import ResponseCache
|
|||
from synapse.util.metrics import Measure, measure_func
|
||||
from synapse.visibility import filter_events_for_client
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.server import HomeServer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Debug logger for https://github.com/matrix-org/synapse/issues/4422
|
||||
|
@ -244,7 +247,7 @@ class SyncResult:
|
|||
|
||||
|
||||
class SyncHandler(object):
|
||||
def __init__(self, hs):
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.hs_config = hs.config
|
||||
self.store = hs.get_datastore()
|
||||
self.notifier = hs.get_notifier()
|
||||
|
@ -717,9 +720,8 @@ class SyncHandler(object):
|
|||
]
|
||||
|
||||
missing_hero_state = await self.store.get_events(missing_hero_event_ids)
|
||||
missing_hero_state = missing_hero_state.values()
|
||||
|
||||
for s in missing_hero_state:
|
||||
for s in missing_hero_state.values():
|
||||
cache.set(s.state_key, s.event_id)
|
||||
state[(EventTypes.Member, s.state_key)] = s
|
||||
|
||||
|
@ -1771,7 +1773,7 @@ class SyncHandler(object):
|
|||
ignored_users: Set[str],
|
||||
room_builder: "RoomSyncResultBuilder",
|
||||
ephemeral: List[JsonDict],
|
||||
tags: Optional[List[JsonDict]],
|
||||
tags: Optional[Dict[str, Dict[str, Any]]],
|
||||
account_data: Dict[str, JsonDict],
|
||||
always_include: bool = False,
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue