synapse-product/synapse
Erik Johnston c72d26c1e1
Refactor EventContext (#12689)
Refactor how the `EventContext` class works, with the intention of reducing the amount of state we fetch from the DB during event processing.

The idea here is to get rid of the cached `current_state_ids` and `prev_state_ids` that live in the `EventContext`, and instead defer straight to the database (and its caching). 

One change that may have a noticeable effect is that we now no longer prefill the `get_current_state_ids` cache on a state change. However, that query is relatively light, since its just a case of reading a table from the DB (unlike fetching state at an event which is more heavyweight). For deployments with workers this cache isn't even used.


Part of #12684
2022-05-10 19:43:13 +00:00
..
_scripts Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
api Fix incorrect type hint in filtering code. (#12695) 2022-05-10 14:10:22 -04:00
app Add the update_user_directory_from_worker configuration option (superseding update_user_directory) to allow a generic worker to be designated as the worker to update the user directory. (#12654) 2022-05-10 11:08:45 +01:00
appservice Update mypy to 0.950 and fix complaints (#12650) 2022-05-06 12:35:20 +00:00
config Add the update_user_directory_from_worker configuration option (superseding update_user_directory) to allow a generic worker to be designated as the worker to update the user directory. (#12654) 2022-05-10 11:08:45 +01:00
crypto Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
events Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
federation Fix inconsistent spelling of 'M_UNRECOGNIZED'. (#12665) 2022-05-09 20:29:07 +00:00
groups Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
handlers Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
http Capture the Deferred for request cancellation in _AsyncResource (#12694) 2022-05-10 20:39:05 +01:00
logging Use getClientAddress instead of getClientIP. (#12599) 2022-05-04 14:11:21 -04:00
metrics Update mypy to 0.950 and fix complaints (#12650) 2022-05-06 12:35:20 +00:00
module_api Use ParamSpec in a few places (#12667) 2022-05-09 10:27:39 +00:00
push Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
replication Update replication.md with info on TCP module structure (#12621) 2022-05-09 14:46:43 -07:00
res Fix Jinja templating error when generating thumbnail URLs. (#12510) 2022-04-20 12:03:03 -04:00
rest Fix mypy against latest pillow stubs (#12671) 2022-05-09 10:48:14 +00:00
server_notices Update the server notices user profile in room if changed. (#12115) 2022-04-08 07:51:27 -04:00
spam_checker_api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
static Display an error page during failure of fallback UIA. (#10561) 2021-08-18 08:13:35 -04:00
storage Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
streams Generate historic pagination token for /messages when no ?from token provided (#12370) 2022-04-06 11:40:28 +01:00
util Immediately retry any requests that have backed off when a server comes back online. (#12500) 2022-05-10 10:39:54 +01:00
__init__.py Dump setuptools; correct pyproject version number (#12478) 2022-04-20 17:33:20 +01:00
event_auth.py Remove excess condition on knock->leave check (#11900) 2022-02-22 18:35:01 +00:00
notifier.py Immediately retry any requests that have backed off when a server comes back online. (#12500) 2022-05-10 10:39:54 +01:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Add a module API to allow modules to edit push rule actions (#12406) 2022-04-27 13:55:33 +00:00
types.py Make StreamToken and RoomStreamToken methods propagate cancellations (#12366) 2022-04-05 16:56:52 +01:00
visibility.py Optimise backfill calculation (#12522) 2022-04-26 10:27:11 +01:00