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

Correct a misnamed argument in state res v2 #13467

Merged
merged 3 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
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/13467.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct a misnamed argument in state res v2 internals.
12 changes: 6 additions & 6 deletions synapse/state/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ async def _add_event_and_auth_chain_to_graph(
event_id: str,
event_map: Dict[str, EventBase],
state_res_store: StateResolutionStore,
auth_diff: Set[str],
full_conflicted_set: Set[str],
) -> None:
"""Helper function for _reverse_topological_power_sort that add the event
and its auth chain (that is in the auth diff) to the graph
Expand All @@ -445,7 +445,7 @@ async def _add_event_and_auth_chain_to_graph(
event_id: Event to add to the graph
event_map
state_res_store
auth_diff: Set of event IDs that are in the auth difference.
full_conflicted_set: Set of event IDs that are in the full conflicted set.
"""

state = [event_id]
Expand All @@ -455,7 +455,7 @@ async def _add_event_and_auth_chain_to_graph(

event = await _get_event(room_id, eid, event_map, state_res_store)
for aid in event.auth_event_ids():
if aid in auth_diff:
if aid in full_conflicted_set:
if aid not in graph:
state.append(aid)

Expand All @@ -468,7 +468,7 @@ async def _reverse_topological_power_sort(
event_ids: Iterable[str],
event_map: Dict[str, EventBase],
state_res_store: StateResolutionStore,
auth_diff: Set[str],
full_conflicted_set: Set[str],
) -> List[str]:
"""Returns a list of the event_ids sorted by reverse topological ordering,
and then by power level and origin_server_ts
Expand All @@ -479,7 +479,7 @@ async def _reverse_topological_power_sort(
event_ids: The events to sort
event_map
state_res_store
auth_diff: Set of event IDs that are in the auth difference.
full_conflicted_set: Set of event IDs that are in the auth difference.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment needs to be updated too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaaaaaaaaaaaa. thanks

DMRobertson marked this conversation as resolved.
Show resolved Hide resolved

Returns:
The sorted list
Expand All @@ -488,7 +488,7 @@ async def _reverse_topological_power_sort(
graph: Dict[str, Set[str]] = {}
for idx, event_id in enumerate(event_ids, start=1):
await _add_event_and_auth_chain_to_graph(
graph, room_id, event_id, event_map, state_res_store, auth_diff
graph, room_id, event_id, event_map, state_res_store, full_conflicted_set
)

# We await occasionally when we're working with large data sets to
Expand Down