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

Faster joins: send heroes to handle nameless rooms #12995

Closed
Tracked by #14030
richvdh opened this issue Jun 9, 2022 · 4 comments · Fixed by #14442
Closed
Tracked by #14030

Faster joins: send heroes to handle nameless rooms #12995

richvdh opened this issue Jun 9, 2022 · 4 comments · Fixed by #14442
Assignees
Labels
A-Federated-Join joins over federation generally suck A-Sync defects related to /sync T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@richvdh
Copy link
Member

richvdh commented Jun 9, 2022

No description provided.

@richvdh richvdh added A-Federated-Join joins over federation generally suck T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Jun 9, 2022
@squahtx squahtx added the A-Sync defects related to /sync label Jun 9, 2022
@richvdh
Copy link
Member Author

richvdh commented Aug 15, 2022

we will need to pass through heroes, to ensure that rooms without their own name get a useful title ("Bob and 4 others", etc)

@richvdh richvdh changed the title Faster joins: improved support for lazy_load_members /sync Faster joins: send heroes to handle nameless rooms Oct 4, 2022
@DMRobertson
Copy link
Contributor

DMRobertson commented Oct 25, 2022

Is this something we can make progress on today? Does the initial set of state events sent from the resident server include the heroes' membership events?

Edit: or is the point that we need to calculate those membership events and include them in the partial join response?

@richvdh
Copy link
Member Author

richvdh commented Oct 25, 2022

yes, the latter: we need to extend the response from /send_join to include heroes.

@DMRobertson
Copy link
Contributor

def _get_event_ids_for_partial_state_join(
join_event: EventBase,
prev_state_ids: StateMap[str],
) -> Collection[str]:
"""Calculate state to be retuned in a partial_state send_join
Args:
join_event: the join event being send_joined
prev_state_ids: the event ids of the state before the join
Returns:
the event ids to be returned
"""
# return all non-member events
state_event_ids = {
event_id
for (event_type, state_key), event_id in prev_state_ids.items()
if event_type != EventTypes.Member
}
# we also need the current state of the current user (it's going to
# be an auth event for the new join, so we may as well return it)
current_membership_event_id = prev_state_ids.get(
(EventTypes.Member, join_event.state_key)
)
if current_membership_event_id is not None:
state_event_ids.add(current_membership_event_id)
# TODO: return a few more members:
# - those with invites
# - those that are kicked? / banned
return state_event_ids
seems like it's a good place to start.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Federated-Join joins over federation generally suck A-Sync defects related to /sync T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants