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

Minor typing fixes for synapse/storage/persist_events.py #12069

Merged
merged 3 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/12069.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minor typing fixes.
9 changes: 4 additions & 5 deletions synapse/storage/persist_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,13 @@ async def _persist_event_batch(
)

for room_id, ev_ctx_rm in events_by_room.items():
latest_event_ids = (
latest_event_ids = set(
await self.main_store.get_latest_event_ids_in_room(room_id)
)
new_latest_event_ids = await self._calculate_new_extremities(
clokep marked this conversation as resolved.
Show resolved Hide resolved
room_id, ev_ctx_rm, latest_event_ids
)

latest_event_ids = set(latest_event_ids)
if new_latest_event_ids == latest_event_ids:
# No change in extremities, so no change in state
continue
Expand Down Expand Up @@ -567,7 +566,7 @@ async def _persist_event_batch(
)
if not is_still_joined:
logger.info("Server no longer in room %s", room_id)
latest_event_ids = []
latest_event_ids = set()
current_state = {}
delta.no_longer_in_room = True

Expand Down Expand Up @@ -906,9 +905,9 @@ async def _prune_extremities(
# Ideally we'd figure out a way of still being able to drop old
# dummy events that reference local events, but this is good enough
# as a first cut.
events_to_check = [event]
events_to_check: Collection[EventBase] = [event]
while events_to_check:
new_events = set()
new_events: Set[str] = set()
for event_to_check in events_to_check:
if self.is_mine_id(event_to_check.sender):
if event_to_check.type != EventTypes.Dummy:
Expand Down