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

Commit

Permalink
Fix bad naming of storage function (#9637)
Browse files Browse the repository at this point in the history
We had two functions named `get_forward_extremities_for_room` and
`get_forward_extremeties_for_room` that took different paramters. We
rename one of them to avoid confusion.
  • Loading branch information
erikjohnston authored Mar 17, 2021
1 parent 567f88f commit ad721fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/9637.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename storage function to fix spelling and not conflict with another functions name.
2 changes: 1 addition & 1 deletion synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async def get_user_ids_changed(

# Fetch the current state at the time.
try:
event_ids = await self.store.get_forward_extremeties_for_room(
event_ids = await self.store.get_forward_extremities_for_room_at_stream_ordering(
room_id, stream_ordering=stream_ordering
)
except errors.StoreError:
Expand Down
6 changes: 4 additions & 2 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,10 @@ async def get_rooms_for_user_at(

logger.info("User joined room after current token: %s", room_id)

extrems = await self.store.get_forward_extremeties_for_room(
room_id, event_pos.stream
extrems = (
await self.store.get_forward_extremities_for_room_at_stream_ordering(
room_id, event_pos.stream
)
)
users_in_room = await self.state.get_current_users_in_room(room_id, extrems)
if user_id in users_in_room:
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ def _get_min_depth_interaction(self, txn, room_id):

return int(min_depth) if min_depth is not None else None

async def get_forward_extremeties_for_room(
async def get_forward_extremities_for_room_at_stream_ordering(
self, room_id: str, stream_ordering: int
) -> List[str]:
"""For a given room_id and stream_ordering, return the forward
Expand Down

0 comments on commit ad721fc

Please sign in to comment.