element-hq / element-hq/synapse

`filter_events_for_server` takes a lot of DB time, and is wrong for state events

Open
#4,094 0 comments 0 reactions 0 assignees View on GitHub
A-Performance O-Uncommon S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#4094](https://github.com/matrix-org/synapse/issues/4094).

---

This is due to it often pulling out all members for the room:

https://github.com/matrix-org/synapse/blob/6cb2e2448ab216ed3c00e2347a8ce5e9a383a552/synapse/visibility.py#L318-L323

But it turns out the majority of `/event/` requests are for events that are in the state, which joined servers should be allowed to see regardless of whether they were joined at the time the state was set. We should a) fix this and b) hopefully we can short circuit a bunch of the work if we first check if the event is in the current state of the room

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.