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

Reduce the amount of room members we pull out when calculating push actions #12653

Closed
erikjohnston opened this issue May 6, 2022 · 0 comments · Fixed by #13078
Closed

Reduce the amount of room members we pull out when calculating push actions #12653

erikjohnston opened this issue May 6, 2022 · 0 comments · Fixed by #13078
Assignees
Labels
A-Push Issues related to push/notifications T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@erikjohnston
Copy link
Member

When we calculate push actions for an event we fetch all users that were in the room at the time:

room_members = await self.store.get_joined_users_from_context(event, context)

However, we only use the result in two places:

  1. For getting the count of the number of users in the room (for evaluating push rules that are based on a count)
  2. Getting the display name of local user who has push enabled

Thus for small servers that only have one or two users in the room, fetching the full state is overkill and causes increased memory and DB usage.

We separately do another state query to find out who should be pushed in the room, at:

current_state_ids = await context.get_current_state_ids()

We should figure out a way to not do this.

@erikjohnston erikjohnston added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label May 6, 2022
@erikjohnston erikjohnston self-assigned this May 10, 2022
@erikjohnston erikjohnston removed their assignment May 10, 2022
@MadLittleMods MadLittleMods added the A-Push Issues related to push/notifications label Jun 3, 2022
@H-Shay H-Shay self-assigned this Jun 3, 2022
@erikjohnston erikjohnston assigned erikjohnston and unassigned H-Shay Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Push Issues related to push/notifications 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