Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Tidy up and type-hint the database engine modules #12734

Merged
merged 10 commits into from
May 16, 2022

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented May 13, 2022

A Friday indulgence.

We tell the engines which module to use as a database driver. I wanted to change this because a) it seems weird, and b) my secret ulterior motive is to add yet more type coverage to Synapse.

Closes #12724.

David Robertson added 4 commits May 13, 2022 17:21
I think this is all a bit weird, and it feels like a home-grown version
of sqlalchemy core. I am not very pleased with the conditional import of psycopg2!
It's completely unused
@@ -32,7 +32,7 @@ class IncorrectDatabaseSetup(RuntimeError):


class BaseDatabaseEngine(Generic[ConnectionType], metaclass=abc.ABCMeta):
def __init__(self, module, database_config: dict):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poor commit hygiene.

self.module.extensions.register_type(self.module.extensions.UNICODE)
class PostgresEngine(BaseDatabaseEngine["psycopg2.connection"]):
def __init__(self, database_config: Mapping[str, Any]):
import psycopg2.extensions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike importing this here rather than at the top level. But this was the least-bad/easiest way I could see to not require existing installations to install psycopg2.

@@ -65,7 +70,7 @@ def check_database(self, db_conn, allow_outdated_version: bool = False):
# docs: The number is formed by converting the major, minor, and
# revision numbers into two-decimal-digit numbers and appending them
# together. For example, version 8.1.5 will be returned as 80105
self._version = db_conn.server_version
self._version = cast(int, db_conn.server_version)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If accepted, python/typeshed#7834 would make this cast redundant.

def __init__(self, module, database_config: Mapping[str, Any]):
def __init__(self, module):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that one might want database config that applies independently of your choice of DB (or DB driver, for that matter). So I don't mind dropping this change if people aren't convinced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that one might want database config that applies independently of your choice of DB (or DB driver, for that matter).

Given your reasoning, I'm in favour of leaving the config parameter in, even if we don't use it currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. 4d8b840 reverts this.

@DMRobertson DMRobertson marked this pull request as ready for review May 13, 2022 18:03
@DMRobertson DMRobertson requested a review from a team as a code owner May 13, 2022 18:03
@DMRobertson DMRobertson marked this pull request as draft May 13, 2022 18:18
@DMRobertson
Copy link
Contributor Author

my secret ulterior motive is to add yet more type coverage to Synapse.

On that front:

$ mypy -p synapse --disallow-untyped-defs | tail -n 1
Found 60 errors in 8 files (checked 487 source files)

This excludes all the tests, of course...

There are also 8 other functions in synapse whose modules have been exempted in mypy.ini.

@DMRobertson DMRobertson marked this pull request as ready for review May 13, 2022 18:32
synapse/storage/types.py Outdated Show resolved Hide resolved
Comment on lines +208 to +211
def in_transaction(self, conn: "psycopg2.connection") -> bool:
import psycopg2.extensions

return conn.status != psycopg2.extensions.STATUS_READY
Copy link
Contributor

@squahtx squahtx May 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we'll be running the import on every database transaction. I think it's fine?
Reimporting a previously imported module didn't seem to take too long in a very unscientific test using the repl:

>>> t0 = time.time(); import psycopg2.extensions; time.time() - t0
1.0013580322265625e-05 (~10 microseconds, worst number)
>>> t0 = time.time(); time.time() - t0
2.384185791015625e-06 (~2.5 microseconds, worst number)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call it "ugly, but fine".

The obstacle blocking us from importing psycopg2 freely in this module is that we except to be able to import PostgresEngine everywhere, even if psycopg2 is not available. For example:

if isinstance(database.engine, PostgresEngine):

if isinstance(self.database_engine, PostgresEngine):

if isinstance(self.database_engine, PostgresEngine):

I mulled over doing something like

  • rename postgres.py to _postgres.py
  • create a new file postgres.py with contents like this:
    try:
        from ._postgres import PostgresEngine
    except ImportError:
        class PostgresEngine: pass
    
    __all__ = ["PostgresEngine"] 

But I'm not sure how well Pycharm and mypy will handle that. Other ideas:

  • have DatabaseEngine have some kind of "engine_kind" attribute which points to an enum. Felt like duplicating information we already know, and just generally gave me a smelly impression.
  • make psycopg2 a mandatory requirement for Synapse, That'd be my preferred option, but I suspect it'd be controversial.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DMRobertson another idea would be to add more flags to database engine that talk about the features as opposed to the specific class. E.g. it looks like those need (respectively):

  • Sequence support
  • RECURSIVE support
  • DISTINCT ON support

E.g. expand the features listed near

@property
def can_native_upsert(self):
"""
Can we use native UPSERTs?
"""
return True
@property
def supports_using_any_list(self):
"""Do we support using `a = ANY(?)` and passing a list"""
return True
@property
def supports_returning(self) -> bool:
"""Do we support the `RETURNING` clause in insert/update/delete?"""
return True

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, though I think it'd be tricky to retrofit those in across the source tree without being familiar with the differences between the two databases.

(Obligatory grumble: I don't want us to be rewriting and maintaining our own version of SQLAlchemy core)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely fair, not trying to scope creep! 👍 I've thought about doing this in the past also!

def __init__(self, module, database_config: Mapping[str, Any]):
def __init__(self, module):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that one might want database config that applies independently of your choice of DB (or DB driver, for that matter).

Given your reasoning, I'm in favour of leaving the config parameter in, even if we don't use it currently.

@squahtx
Copy link
Contributor

squahtx commented May 16, 2022

Everything else makes sense!

@DMRobertson DMRobertson requested a review from squahtx May 16, 2022 18:28
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for writing documentation for the DBABI interface.

I've some really nitty stylistic suggestions that are roughly:

  • unabbreviate OS and DB (I have trauma from C codebases)
  • backtick class names
  • s/you/we/
  • make every example a sentence ending in a full stop for consistency

synapse/storage/types.py Outdated Show resolved Hide resolved
synapse/storage/types.py Outdated Show resolved Hide resolved
synapse/storage/types.py Outdated Show resolved Hide resolved
synapse/storage/types.py Outdated Show resolved Hide resolved
synapse/storage/types.py Outdated Show resolved Hide resolved
synapse/storage/types.py Outdated Show resolved Hide resolved
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
@DMRobertson DMRobertson requested a review from squahtx May 16, 2022 20:44
@DMRobertson DMRobertson merged commit 1fe202a into develop May 16, 2022
@DMRobertson DMRobertson deleted the dmr/typing/database branch May 16, 2022 23:34
squahtx pushed a commit that referenced this pull request May 24, 2022
Synapse 1.60.0rc1 (2022-05-24)
==============================

This release of Synapse adds a unique index to the `state_group_edges` table, in
order to prevent accidentally introducing duplicate information (for example,
because a database backup was restored multiple times). If your Synapse database
already has duplicate rows in this table, this could fail with an error and
require manual remediation.

Additionally, the signature of the `check_event_for_spam` module callback has changed.
The previous signature has been deprecated and remains working for now. Module authors
should update their modules to use the new signature where possible.

See [the upgrade notes](https://github.com/matrix-org/synapse/blob/develop/docs/upgrade.md#upgrading-to-v1600)
for more details.

Features
--------

- Measure the time taken in spam-checking callbacks and expose those measurements as metrics. ([\#12513](#12513))
- Add a `default_power_level_content_override` config option to set default room power levels per room preset. ([\#12618](#12618))
- Add support for [MSC3787: Allowing knocks to restricted rooms](matrix-org/matrix-spec-proposals#3787). ([\#12623](#12623))
- Send `USER_IP` commands on a different Redis channel, in order to reduce traffic to workers that do not process these commands. ([\#12672](#12672), [\#12809](#12809))
- Synapse will now reload [cache config](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#caching) when it receives a [SIGHUP](https://en.wikipedia.org/wiki/SIGHUP) signal. ([\#12673](#12673))
- Add a config options to allow for auto-tuning of caches. ([\#12701](#12701))
- Update [MSC2716](matrix-org/matrix-spec-proposals#2716) implementation to process marker events from the current state to avoid markers being lost in timeline gaps for federated servers which would cause the imported history to be undiscovered. ([\#12718](#12718))
- Add a `drop_federated_event` callback to `SpamChecker` to disregard inbound federated events before they take up much processing power, in an emergency. ([\#12744](#12744))
- Implement [MSC3818: Copy room type on upgrade](matrix-org/matrix-spec-proposals#3818). ([\#12786](#12786), [\#12792](#12792))
- Update to the `check_event_for_spam` module callback. Deprecate the current callback signature, replace it with a new signature that is both less ambiguous (replacing booleans with explicit allow/block) and more powerful (ability to return explicit error codes). ([\#12808](#12808))

Bugfixes
--------

- Fix a bug introduced in Synapse 1.7.0 that would prevent events from being sent to clients if there's a retention policy in the room when the support for retention policies is disabled. ([\#12611](#12611))
- Fix a bug introduced in Synapse 1.57.0 where `/messages` would throw a 500 error when querying for a non-existent room. ([\#12683](#12683))
- Add a unique index to `state_group_edges` to prevent duplicates being accidentally introduced and the consequential impact to performance. ([\#12687](#12687))
- Fix a long-standing bug where an empty room would be created when a user with an insufficient power level tried to upgrade a room. ([\#12696](#12696))
- Fix a bug introduced in Synapse 1.30.0 where empty rooms could be automatically created if a monthly active users limit is set. ([\#12713](#12713))
- Fix push to dismiss notifications when read on another client. Contributed by @SpiritCroc @ Beeper. ([\#12721](#12721))
- Fix poor database performance when reading the cache invalidation stream for large servers with lots of workers. ([\#12747](#12747))
- Delete events from the `federation_inbound_events_staging` table when a room is purged through the admin API. ([\#12770](#12770))
- Give a meaningful error message when a client tries to create a room with an invalid alias localpart. ([\#12779](#12779))
- Fix a bug introduced in 1.43.0 where a file (`providers.json`) was never closed. Contributed by @arkamar. ([\#12794](#12794))
- Fix a long-standing bug where finished log contexts would be re-started when failing to contact remote homeservers. ([\#12803](#12803))
- Fix a bug, introduced in Synapse 1.21.0, that led to media thumbnails being unusable before the index has been added in the background. ([\#12823](#12823))

Updates to the Docker image
---------------------------

- Fix the docker file after a dependency update. ([\#12853](#12853))

Improved Documentation
----------------------

- Fix a typo in the Media Admin API documentation. ([\#12715](#12715))
- Update the OpenID Connect example for Keycloak to be compatible with newer versions of Keycloak. Contributed by @nhh. ([\#12727](#12727))
- Fix typo in server listener documentation. ([\#12742](#12742))
- Link to the configuration manual from the welcome page of the documentation. ([\#12748](#12748))
- Fix typo in `run_background_tasks_on` option name in configuration manual documentation. ([\#12749](#12749))
- Add information regarding the `rc_invites` ratelimiting option to the configuration docs. ([\#12759](#12759))
- Add documentation for cancellation of request processing. ([\#12761](#12761))
- Recommend using docker to run tests against postgres. ([\#12765](#12765))
- Add missing user directory endpoint from the generic worker documentation. Contributed by @olmari. ([\#12773](#12773))
- Add additional info to documentation of config option `cache_autotuning`. ([\#12776](#12776))
- Update configuration manual documentation to document size-related suffixes. ([\#12777](#12777))
- Fix invalid YAML syntax in the example documentation for the `url_preview_accept_language` config option. ([\#12785](#12785))

Deprecations and Removals
-------------------------

- Require a body in POST requests to `/rooms/{roomId}/receipt/{receiptType}/{eventId}`, as required by the [Matrix specification](https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3roomsroomidreceiptreceipttypeeventid). This breaks compatibility with Element Android 1.2.0 and earlier: users of those clients will be unable to send read receipts. ([\#12709](#12709))

Internal Changes
----------------

- Improve event caching mechanism to avoid having multiple copies of an event in memory at a time. ([\#10533](#10533))
- Preparation for faster-room-join work: return subsets of room state which we already have, immediately. ([\#12498](#12498))
- Add `@cancellable` decorator, for use on endpoint methods that can be cancelled when clients disconnect. ([\#12586](#12586), [\#12588](#12588), [\#12630](#12630), [\#12694](#12694), [\#12698](#12698), [\#12699](#12699), [\#12700](#12700), [\#12705](#12705))
- Enable cancellation of `GET /rooms/$room_id/members`, `GET /rooms/$room_id/state` and `GET /rooms/$room_id/state/$event_type/*` requests. ([\#12708](#12708))
- Improve documentation of the `synapse.push` module. ([\#12676](#12676))
- Refactor functions to on `PushRuleEvaluatorForEvent`. ([\#12677](#12677))
- Preparation for database schema simplifications: stop writing to `event_reference_hashes`. ([\#12679](#12679))
- Remove code which updates unused database column `application_services_state.last_txn`. ([\#12680](#12680))
- Refactor `EventContext` class. ([\#12689](#12689))
- Remove an unneeded class in the push code. ([\#12691](#12691))
- Consolidate parsing of relation information from events. ([\#12693](#12693))
- Convert namespace class `Codes` into a string enum. ([\#12703](#12703))
- Optimize private read receipt filtering. ([\#12711](#12711))
- Drop the logging level of status messages for the URL preview cache expiry job from INFO to DEBUG. ([\#12720](#12720))
- Downgrade some OIDC errors to warnings in the logs, to reduce the noise of Sentry reports. ([\#12723](#12723))
- Update configs used by Complement to allow more invites/3PID validations during tests. ([\#12731](#12731))
- Fix a long-standing bug where the user directory background process would fail to make forward progress if a user included a null codepoint in their display name or avatar. ([\#12762](#12762))
- Tweak the mypy plugin so that `@cached` can accept `on_invalidate=None`. ([\#12769](#12769))
- Move methods that call `add_push_rule` to the `PushRuleStore` class. ([\#12772](#12772))
- Make handling of federation Authorization header (more) compliant with RFC7230. ([\#12774](#12774))
- Refactor `resolve_state_groups_for_events` to not pull out full state when no state resolution happens. ([\#12775](#12775))
- Do not keep going if there are 5 back-to-back background update failures. ([\#12781](#12781))
- Fix federation when using the demo scripts. ([\#12783](#12783))
- The `hash_password` script now fails when it is called without specifying a config file. Contributed by @jae1911. ([\#12789](#12789))
- Improve and fix type hints. ([\#12567](#12567), [\#12477](#12477), [\#12717](#12717), [\#12753](#12753), [\#12695](#12695), [\#12734](#12734), [\#12716](#12716), [\#12726](#12726), [\#12790](#12790), [\#12833](#12833))
- Update EventContext `get_current_event_ids` and `get_prev_event_ids` to accept state filters and update calls where possible. ([\#12791](#12791))
- Remove Caddy from the Synapse workers image used in Complement. ([\#12818](#12818))
- Add Complement's shared registration secret to the Complement worker image. This fixes tests that depend on it. ([\#12819](#12819))
- Support registering Application Services when running with workers under Complement. ([\#12826](#12826))
- Disable 'faster room join' Complement tests when testing against Synapse with workers. ([\#12842](#12842))
Danieloni1 added a commit to globekeeper/synapse that referenced this pull request Jun 8, 2022
Synapse 1.60.0 (2022-05-31)
===========================

This release of Synapse adds a unique index to the `state_group_edges` table, in
order to prevent accidentally introducing duplicate information (for example,
because a database backup was restored multiple times). If your Synapse database
already has duplicate rows in this table, this could fail with an error and
require manual remediation.

Additionally, the signature of the `check_event_for_spam` module callback has changed.
The previous signature has been deprecated and remains working for now. Module authors
should update their modules to use the new signature where possible.

See [the upgrade notes](https://github.com/matrix-org/synapse/blob/develop/docs/upgrade.md#upgrading-to-v1600)
for more details.

Bugfixes
--------

- Fix a bug introduced in Synapse 1.60.0rc1 that would break some imports from `synapse.module_api`. ([\matrix-org#12918](matrix-org#12918))

Synapse 1.60.0rc2 (2022-05-27)
==============================

Features
--------

- Add an option allowing users to use their password to reauthenticate for privileged actions even though password login is disabled. ([\matrix-org#12883](matrix-org#12883))

Bugfixes
--------

- Explicitly close `ijson` coroutines once we are done with them, instead of leaving the garbage collector to close them. ([\matrix-org#12875](matrix-org#12875))

Internal Changes
----------------

- Improve URL previews by not including the content of media tags in the generated description. ([\matrix-org#12887](matrix-org#12887))

Synapse 1.60.0rc1 (2022-05-24)
==============================

Features
--------

- Measure the time taken in spam-checking callbacks and expose those measurements as metrics. ([\matrix-org#12513](matrix-org#12513))
- Add a `default_power_level_content_override` config option to set default room power levels per room preset. ([\matrix-org#12618](matrix-org#12618))
- Add support for [MSC3787: Allowing knocks to restricted rooms](matrix-org/matrix-spec-proposals#3787). ([\matrix-org#12623](matrix-org#12623))
- Send `USER_IP` commands on a different Redis channel, in order to reduce traffic to workers that do not process these commands. ([\matrix-org#12672](matrix-org#12672), [\matrix-org#12809](matrix-org#12809))
- Synapse will now reload [cache config](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#caching) when it receives a [SIGHUP](https://en.wikipedia.org/wiki/SIGHUP) signal. ([\matrix-org#12673](matrix-org#12673))
- Add a config options to allow for auto-tuning of caches. ([\matrix-org#12701](matrix-org#12701))
- Update [MSC2716](matrix-org/matrix-spec-proposals#2716) implementation to process marker events from the current state to avoid markers being lost in timeline gaps for federated servers which would cause the imported history to be undiscovered. ([\matrix-org#12718](matrix-org#12718))
- Add a `drop_federated_event` callback to `SpamChecker` to disregard inbound federated events before they take up much processing power, in an emergency. ([\matrix-org#12744](matrix-org#12744))
- Implement [MSC3818: Copy room type on upgrade](matrix-org/matrix-spec-proposals#3818). ([\matrix-org#12786](matrix-org#12786), [\matrix-org#12792](matrix-org#12792))
- Update to the `check_event_for_spam` module callback. Deprecate the current callback signature, replace it with a new signature that is both less ambiguous (replacing booleans with explicit allow/block) and more powerful (ability to return explicit error codes). ([\matrix-org#12808](matrix-org#12808))

Bugfixes
--------

- Fix a bug introduced in Synapse 1.7.0 that would prevent events from being sent to clients if there's a retention policy in the room when the support for retention policies is disabled. ([\matrix-org#12611](matrix-org#12611))
- Fix a bug introduced in Synapse 1.57.0 where `/messages` would throw a 500 error when querying for a non-existent room. ([\matrix-org#12683](matrix-org#12683))
- Add a unique index to `state_group_edges` to prevent duplicates being accidentally introduced and the consequential impact to performance. ([\matrix-org#12687](matrix-org#12687))
- Fix a long-standing bug where an empty room would be created when a user with an insufficient power level tried to upgrade a room. ([\matrix-org#12696](matrix-org#12696))
- Fix a bug introduced in Synapse 1.30.0 where empty rooms could be automatically created if a monthly active users limit is set. ([\matrix-org#12713](matrix-org#12713))
- Fix push to dismiss notifications when read on another client. Contributed by @SpiritCroc @ Beeper. ([\matrix-org#12721](matrix-org#12721))
- Fix poor database performance when reading the cache invalidation stream for large servers with lots of workers. ([\matrix-org#12747](matrix-org#12747))
- Delete events from the `federation_inbound_events_staging` table when a room is purged through the admin API. ([\matrix-org#12770](matrix-org#12770))
- Give a meaningful error message when a client tries to create a room with an invalid alias localpart. ([\matrix-org#12779](matrix-org#12779))
- Fix a bug introduced in 1.43.0 where a file (`providers.json`) was never closed. Contributed by @arkamar. ([\matrix-org#12794](matrix-org#12794))
- Fix a long-standing bug where finished log contexts would be re-started when failing to contact remote homeservers. ([\matrix-org#12803](matrix-org#12803))
- Fix a bug, introduced in Synapse 1.21.0, that led to media thumbnails being unusable before the index has been added in the background. ([\matrix-org#12823](matrix-org#12823))

Updates to the Docker image
---------------------------

- Fix the docker file after a dependency update. ([\matrix-org#12853](matrix-org#12853))

Improved Documentation
----------------------

- Fix a typo in the Media Admin API documentation. ([\matrix-org#12715](matrix-org#12715))
- Update the OpenID Connect example for Keycloak to be compatible with newer versions of Keycloak. Contributed by @nhh. ([\matrix-org#12727](matrix-org#12727))
- Fix typo in server listener documentation. ([\matrix-org#12742](matrix-org#12742))
- Link to the configuration manual from the welcome page of the documentation. ([\matrix-org#12748](matrix-org#12748))
- Fix typo in `run_background_tasks_on` option name in configuration manual documentation. ([\matrix-org#12749](matrix-org#12749))
- Add information regarding the `rc_invites` ratelimiting option to the configuration docs. ([\matrix-org#12759](matrix-org#12759))
- Add documentation for cancellation of request processing. ([\matrix-org#12761](matrix-org#12761))
- Recommend using docker to run tests against postgres. ([\matrix-org#12765](matrix-org#12765))
- Add missing user directory endpoint from the generic worker documentation. Contributed by @olmari. ([\matrix-org#12773](matrix-org#12773))
- Add additional info to documentation of config option `cache_autotuning`. ([\matrix-org#12776](matrix-org#12776))
- Update configuration manual documentation to document size-related suffixes. ([\matrix-org#12777](matrix-org#12777))
- Fix invalid YAML syntax in the example documentation for the `url_preview_accept_language` config option. ([\matrix-org#12785](matrix-org#12785))

Deprecations and Removals
-------------------------

- Require a body in POST requests to `/rooms/{roomId}/receipt/{receiptType}/{eventId}`, as required by the [Matrix specification](https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3roomsroomidreceiptreceipttypeeventid). This breaks compatibility with Element Android 1.2.0 and earlier: users of those clients will be unable to send read receipts. ([\matrix-org#12709](matrix-org#12709))

Internal Changes
----------------

- Improve event caching mechanism to avoid having multiple copies of an event in memory at a time. ([\matrix-org#10533](matrix-org#10533))
- Preparation for faster-room-join work: return subsets of room state which we already have, immediately. ([\matrix-org#12498](matrix-org#12498))
- Add `@cancellable` decorator, for use on endpoint methods that can be cancelled when clients disconnect. ([\matrix-org#12586](matrix-org#12586), [\matrix-org#12588](matrix-org#12588), [\matrix-org#12630](matrix-org#12630), [\matrix-org#12694](matrix-org#12694), [\matrix-org#12698](matrix-org#12698), [\matrix-org#12699](matrix-org#12699), [\matrix-org#12700](matrix-org#12700), [\matrix-org#12705](matrix-org#12705))
- Enable cancellation of `GET /rooms/$room_id/members`, `GET /rooms/$room_id/state` and `GET /rooms/$room_id/state/$event_type/*` requests. ([\matrix-org#12708](matrix-org#12708))
- Improve documentation of the `synapse.push` module. ([\matrix-org#12676](matrix-org#12676))
- Refactor functions to on `PushRuleEvaluatorForEvent`. ([\matrix-org#12677](matrix-org#12677))
- Preparation for database schema simplifications: stop writing to `event_reference_hashes`. ([\matrix-org#12679](matrix-org#12679))
- Remove code which updates unused database column `application_services_state.last_txn`. ([\matrix-org#12680](matrix-org#12680))
- Refactor `EventContext` class. ([\matrix-org#12689](matrix-org#12689))
- Remove an unneeded class in the push code. ([\matrix-org#12691](matrix-org#12691))
- Consolidate parsing of relation information from events. ([\matrix-org#12693](matrix-org#12693))
- Convert namespace class `Codes` into a string enum. ([\matrix-org#12703](matrix-org#12703))
- Optimize private read receipt filtering. ([\matrix-org#12711](matrix-org#12711))
- Drop the logging level of status messages for the URL preview cache expiry job from INFO to DEBUG. ([\matrix-org#12720](matrix-org#12720))
- Downgrade some OIDC errors to warnings in the logs, to reduce the noise of Sentry reports. ([\matrix-org#12723](matrix-org#12723))
- Update configs used by Complement to allow more invites/3PID validations during tests. ([\matrix-org#12731](matrix-org#12731))
- Fix a long-standing bug where the user directory background process would fail to make forward progress if a user included a null codepoint in their display name or avatar. ([\matrix-org#12762](matrix-org#12762))
- Tweak the mypy plugin so that `@cached` can accept `on_invalidate=None`. ([\matrix-org#12769](matrix-org#12769))
- Move methods that call `add_push_rule` to the `PushRuleStore` class. ([\matrix-org#12772](matrix-org#12772))
- Make handling of federation Authorization header (more) compliant with RFC7230. ([\matrix-org#12774](matrix-org#12774))
- Refactor `resolve_state_groups_for_events` to not pull out full state when no state resolution happens. ([\matrix-org#12775](matrix-org#12775))
- Do not keep going if there are 5 back-to-back background update failures. ([\matrix-org#12781](matrix-org#12781))
- Fix federation when using the demo scripts. ([\matrix-org#12783](matrix-org#12783))
- The `hash_password` script now fails when it is called without specifying a config file. Contributed by @jae1911. ([\matrix-org#12789](matrix-org#12789))
- Improve and fix type hints. ([\matrix-org#12567](matrix-org#12567), [\matrix-org#12477](matrix-org#12477), [\matrix-org#12717](matrix-org#12717), [\matrix-org#12753](matrix-org#12753), [\matrix-org#12695](matrix-org#12695), [\matrix-org#12734](matrix-org#12734), [\matrix-org#12716](matrix-org#12716), [\matrix-org#12726](matrix-org#12726), [\matrix-org#12790](matrix-org#12790), [\matrix-org#12833](matrix-org#12833))
- Update EventContext `get_current_event_ids` and `get_prev_event_ids` to accept state filters and update calls where possible. ([\matrix-org#12791](matrix-org#12791))
- Remove Caddy from the Synapse workers image used in Complement. ([\matrix-org#12818](matrix-org#12818))
- Add Complement's shared registration secret to the Complement worker image. This fixes tests that depend on it. ([\matrix-org#12819](matrix-org#12819))
- Support registering Application Services when running with workers under Complement. ([\matrix-org#12826](matrix-org#12826))
- Disable 'faster room join' Complement tests when testing against Synapse with workers. ([\matrix-org#12842](matrix-org#12842))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce use of self.module in BaseDatabaseEngine and subclasses.
3 participants