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

Commit

Permalink
Minor typing fixes for synapse/storage/persist_events.py
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Quah <[email protected]>
  • Loading branch information
Sean Quah committed Feb 23, 2022
1 parent 5b2b368 commit 9fdbad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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(
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

0 comments on commit 9fdbad0

Please sign in to comment.