forked-synapse/synapse/handlers
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
..
ui_auth Remove the deprecated Handlers object (#8494) 2020-10-09 07:24:34 -04:00
__init__.py Remove the deprecated Handlers object (#8494) 2020-10-09 07:24:34 -04:00
_base.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
account_data.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
account_validity.py Add type hints for account validity handler (#8620) 2020-10-26 14:17:31 -04:00
acme_issuing_service.py Use slots in attrs classes where possible (#8296) 2020-09-14 12:50:06 -04:00
acme.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
admin.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
appservice.py Improve appservice handler to send only the most recent read receipts when no stream_id is stored. (#8744) 2020-11-18 18:54:09 +00:00
auth.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
cas_handler.py Properly report user-agent/IP during registration of SSO users. (#8784) 2020-11-23 13:28:03 -05:00
deactivate_account.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
device.py Add typing information to the device handler. (#8407) 2020-10-07 08:58:21 -04:00
devicemessage.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
directory.py Allow ThirdPartyEventRules modules to manipulate public room state (#8292) 2020-10-05 14:57:46 +01:00
e2e_keys.py e2e: ensure we have both master and self-signing key (#8455) 2020-10-26 18:37:47 +00:00
e2e_room_keys.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
events.py Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
federation.py Consistently use room_id from federation request body (#8776) 2020-11-19 10:05:33 +00:00
groups_local.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
identity.py Fix handling of connection timeouts in outgoing http requests (#8400) 2020-09-29 10:29:21 +01:00
initial_sync.py Add type hints to profile and base handlers. (#8609) 2020-10-21 06:44:31 -04:00
message.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
oidc_handler.py Support trying multiple localparts for OpenID Connect. (#8801) 2020-11-25 10:04:22 -05:00
pagination.py Move additional tasks to the background worker, part 4 (#8513) 2020-10-13 08:20:32 -04:00
password_policy.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
presence.py Use TYPE_CHECKING instead of magic MYPY variable. (#8770) 2020-11-17 09:09:40 -05:00
profile.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
read_marker.py Add type hints to some handlers (#8505) 2020-10-09 07:20:51 -04:00
receipts.py Improve appservice handler to send only the most recent read receipts when no stream_id is stored. (#8744) 2020-11-18 18:54:09 +00:00
register.py Properly report user-agent/IP during registration of SSO users. (#8784) 2020-11-23 13:28:03 -05:00
room_list.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_member_worker.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_member.py Speed up remote invite rejection database call (#8815) 2020-11-25 20:06:13 +00:00
room.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
saml_handler.py Support trying multiple localparts for OpenID Connect. (#8801) 2020-11-25 10:04:22 -05:00
search.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
set_password.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
sso.py Support trying multiple localparts for OpenID Connect. (#8801) 2020-11-25 10:04:22 -05:00
state_deltas.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00
stats.py Allow background tasks to be run on a separate worker. (#8369) 2020-10-02 08:23:15 -04:00
sync.py Add admin API for logging in as a user (#8617) 2020-11-17 10:51:25 +00:00
typing.py Don't unnecessarily start bg process while handling typing. (#8668) 2020-10-27 15:32:19 +00:00
user_directory.py Fix typos and spelling errors. (#8639) 2020-10-23 12:38:40 -04:00