Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was 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

@erikjohnston

Description

@erikjohnston

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.

Metadata

Metadata

Labels

A-PushIssues related to push/notificationsT-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions