Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to specify a filter for /_matrix/client/v3/rooms/{roomId}/state #2019

Open
Half-Shot opened this issue Nov 29, 2024 · 0 comments
Open
Labels
improvement An idea/future MSC for the spec

Comments

@Half-Shot
Copy link
Contributor

For https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidstate

When working on specific integrations (notably, those that do not /sync) it's common practice to pull in state for a room via the /state API. The reason for doing so is that often you want several state events, and events of the same type. There isn't another way currently to fetch many state events of the same type, as the only APIs that exist are /state, and /state/{eventType}/{stateKey}.

Therefore, often a lot of time is wasted gathering the entire state of the room and sending it along to the integration whereby most of it (e.g. members) are thrown out immediately. Performance could be improved on both sides by allowing a mechanism to filter for the state you care about instead.

For the example of hookshot, we have many state event types that we support (uk.half-shot.hookshot.github.*) but also many that we don't care about. Often the startup loop consists of fetching all state for a room, and then determining it's room type(s) by the events that get returned. A lot of time could be saved by specifying a filter here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An idea/future MSC for the spec
Projects
None yet
Development

No branches or pull requests

1 participant