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

Add some type hints to event_federation datastore #12753

Merged
merged 8 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12753.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some type hints to datastore.
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ exclude = (?x)
|synapse/storage/databases/__init__.py
|synapse/storage/databases/main/cache.py
|synapse/storage/databases/main/devices.py
|synapse/storage/databases/main/event_federation.py
|synapse/storage/schema/

|tests/api/test_auth.py
Expand Down
2 changes: 2 additions & 0 deletions synapse/handlers/room_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async def inherit_depth_from_prev_ids(self, prev_event_ids: List[str]) -> int:
# We want to use the successor event depth so they appear after `prev_event` because
# it has a larger `depth` but before the successor event because the `stream_ordering`
# is negative before the successor event.
assert most_recent_prev_event_id is not None
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
successor_event_ids = await self.store.get_successor_events(
most_recent_prev_event_id
)
Expand Down Expand Up @@ -139,6 +140,7 @@ async def get_most_recent_full_state_ids_from_event_id_list(
_,
) = await self.store.get_max_depth_of(event_ids)
# mapping from (type, state_key) -> state_event_id
assert most_recent_event_id is not None
prev_state_map = await self.state_store.get_state_ids_for_event(
most_recent_event_id
)
Expand Down
Loading