synapse-product/synapse
Andrew Morgan d963c69ba5
Speed up remote invite rejection database call (#8815)
This is another PR that grew out of #6739.

The existing code for checking whether a user is currently invited to a room when they want to leave the room looks like the following:

f737368a26/synapse/handlers/room_member.py (L518-L540)

It calls `get_invite_for_local_user_in_room`, which will actually query *all* rooms the user has been invited to, before iterating over them and matching via the room ID. It will then return a tuple of a lot of information which we pull the event ID out of.

I need to do a similar check for knocking, but this code wasn't very efficient. I then tried to write a different implementation using `StateHandler.get_current_state` but this actually didn't work as we haven't *joined* the room yet - we've only been invited to it. That means that only certain tables in Synapse have our desired `invite` membership state. One of those tables is `local_current_membership`.

So I wrote a store method that just queries that table instead
2020-11-25 20:06:13 +00:00
..
_scripts Remove obsolete __future__ imports (#8337) 2020-09-17 08:37:01 -04:00
api Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
app Fix SIGHUP handler (#8697) 2020-11-06 11:42:07 +00:00
appservice Tie together matches_user_in_member_list and get_users_in_room caches (#8676) 2020-10-30 15:23:16 +00:00
config SAML: Allow specifying the IdP entityid to use. (#8630) 2020-11-19 09:57:13 -05:00
crypto Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
events Use TYPE_CHECKING instead of magic MYPY variable. (#8770) 2020-11-17 09:09:40 -05:00
federation Consistently use room_id from federation request body (#8776) 2020-11-19 10:05:33 +00:00
groups Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
handlers Speed up remote invite rejection database call (#8815) 2020-11-25 20:06:13 +00:00
http Add additional type hints to HTTP client. (#8812) 2020-11-25 13:30:47 -05:00
logging Gracefully handle a pending logging connection during shutdown. (#8685) 2020-10-29 12:53:57 -04:00
metrics Add metrics for tracking 3PID /requestToken requests. (#8712) 2020-11-13 12:03:51 +00:00
module_api Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
push Add base pushrule to notify for jitsi conferences (#8286) 2020-11-02 16:36:14 +00:00
replication Generalise _maybe_store_room_on_invite (#8754) 2020-11-13 16:24:04 +00:00
res/templates Include a simple message in email notifications that include encrypted content (#8545) 2020-10-19 09:12:39 -04:00
rest Use TYPE_CHECKING instead of magic MYPY variable. (#8770) 2020-11-17 09:09:40 -05:00
server_notices Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
spam_checker_api Combine SpamCheckerApi with the more generic ModuleApi. (#8464) 2020-10-07 12:03:26 +01:00
state Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
static Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
storage Speed up remote invite rejection database call (#8815) 2020-11-25 20:06:13 +00:00
streams Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
util Merge pull request #8678 from matrix-org/rav/fix_frozen_events 2020-10-30 15:24:10 +00:00
__init__.py 1.23.0 2020-11-18 11:41:41 +00:00
event_auth.py Ensure that event.redacts is the proper type before handling it (#8457) 2020-10-05 10:24:17 -04:00
notifier.py Don't pull event from DB when handling replication traffic. (#8669) 2020-10-28 12:11:45 +00:00
python_dependencies.py Cap the version of prometheus_client to <v0.9.0 in the dockerfile (#8767) 2020-11-17 16:01:33 +00:00
secrets.py
server.py Add type hints to matrix federation client / agent. (#8806) 2020-11-25 07:07:21 -05:00
types.py Improve error checking for OIDC/SAML mapping providers (#8774) 2020-11-19 14:25:17 -05:00
visibility.py Do not assume that account data is of the correct form. (#8454) 2020-10-05 09:28:05 -04:00