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

Commit 50ae4ea

Browse files
Add some type hints to event_federation datastore (#12753)
Co-authored-by: David Robertson <[email protected]>
1 parent 682431e commit 50ae4ea

File tree

5 files changed

+127
-65
lines changed

5 files changed

+127
-65
lines changed

changelog.d/12753.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add some type hints to datastore.

mypy.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ exclude = (?x)
2727
|synapse/storage/databases/__init__.py
2828
|synapse/storage/databases/main/cache.py
2929
|synapse/storage/databases/main/devices.py
30-
|synapse/storage/databases/main/event_federation.py
3130
|synapse/storage/schema/
3231

3332
|tests/api/test_auth.py

synapse/handlers/room_batch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ async def inherit_depth_from_prev_ids(self, prev_event_ids: List[str]) -> int:
5353
# We want to use the successor event depth so they appear after `prev_event` because
5454
# it has a larger `depth` but before the successor event because the `stream_ordering`
5555
# is negative before the successor event.
56+
assert most_recent_prev_event_id is not None
5657
successor_event_ids = await self.store.get_successor_events(
5758
most_recent_prev_event_id
5859
)
@@ -139,6 +140,7 @@ async def get_most_recent_full_state_ids_from_event_id_list(
139140
_,
140141
) = await self.store.get_max_depth_of(event_ids)
141142
# mapping from (type, state_key) -> state_event_id
143+
assert most_recent_event_id is not None
142144
prev_state_map = await self.state_store.get_state_ids_for_event(
143145
most_recent_event_id
144146
)

0 commit comments

Comments
 (0)