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

Commit

Permalink
Add some type hints to event_federation datastore (#12753)
Browse files Browse the repository at this point in the history
Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
  • Loading branch information
dklimpel and DMRobertson authored May 18, 2022
1 parent 682431e commit 50ae4ea
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 65 deletions.
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
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

0 comments on commit 50ae4ea

Please sign in to comment.