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

Commit ad721fc

Browse files
authored
Fix bad naming of storage function (#9637)
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.
1 parent 567f88f commit ad721fc

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

changelog.d/9637.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename storage function to fix spelling and not conflict with another functions name.

synapse/handlers/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async def get_user_ids_changed(
166166

167167
# Fetch the current state at the time.
168168
try:
169-
event_ids = await self.store.get_forward_extremeties_for_room(
169+
event_ids = await self.store.get_forward_extremities_for_room_at_stream_ordering(
170170
room_id, stream_ordering=stream_ordering
171171
)
172172
except errors.StoreError:

synapse/handlers/sync.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,8 +1979,10 @@ async def get_rooms_for_user_at(
19791979

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

1982-
extrems = await self.store.get_forward_extremeties_for_room(
1983-
room_id, event_pos.stream
1982+
extrems = (
1983+
await self.store.get_forward_extremities_for_room_at_stream_ordering(
1984+
room_id, event_pos.stream
1985+
)
19841986
)
19851987
users_in_room = await self.state.get_current_users_in_room(room_id, extrems)
19861988
if user_id in users_in_room:

synapse/storage/databases/main/event_federation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def _get_min_depth_interaction(self, txn, room_id):
793793

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

796-
async def get_forward_extremeties_for_room(
796+
async def get_forward_extremities_for_room_at_stream_ordering(
797797
self, room_id: str, stream_ordering: int
798798
) -> List[str]:
799799
"""For a given room_id and stream_ordering, return the forward

0 commit comments

Comments
 (0)