Merge branch 'release-v1.55' into develop

This commit is contained in:
Patrick Cloke 2022-03-16 12:22:07 -04:00
commit 3f7cfbc9e5
67 changed files with 126 additions and 66 deletions

View File

@ -1,3 +1,88 @@
Synapse 1.55.0rc1 (2022-03-15)
==============================
This release removes a workaround introduced in Synapse 1.50.0 for Mjolnir compatibility. **This breaks compatibility with Mjolnir 1.3.1 and earlier. ([\#11700](https://github.com/matrix-org/synapse/issues/11700))**; Mjolnir users should upgrade Mjolnir before upgrading Synapse to this version.
Features
--------
- Add third-party rules callbacks `check_can_shutdown_room` and `check_can_deactivate_user`. ([\#12028](https://github.com/matrix-org/synapse/issues/12028))
- Improve performance of logging in for large accounts. ([\#12132](https://github.com/matrix-org/synapse/issues/12132))
- Add experimental env var `SYNAPSE_ASYNC_IO_REACTOR` that causes Synapse to use the asyncio reactor for Twisted. ([\#12135](https://github.com/matrix-org/synapse/issues/12135))
- Support the stable identifiers from [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440): threads. ([\#12151](https://github.com/matrix-org/synapse/issues/12151))
- Add a new Jinja2 template filter to extract the local part of an email address. ([\#12212](https://github.com/matrix-org/synapse/issues/12212))
Bugfixes
--------
- Use the proper serialization format for bundled thread aggregations. The bug has existed since Synapse v1.48.0. ([\#12090](https://github.com/matrix-org/synapse/issues/12090))
- Fix a long-standing bug when redacting events with relations. ([\#12113](https://github.com/matrix-org/synapse/issues/12113), [\#12121](https://github.com/matrix-org/synapse/issues/12121), [\#12130](https://github.com/matrix-org/synapse/issues/12130), [\#12189](https://github.com/matrix-org/synapse/issues/12189))
- Fix a bug introduced in Synapse 1.7.2 whereby background updates are never run with the default background batch size. ([\#12157](https://github.com/matrix-org/synapse/issues/12157))
- Fix a bug where non-standard information was returned from the `/hierarchy` API. Introduced in Synapse v1.41.0. ([\#12175](https://github.com/matrix-org/synapse/issues/12175))
- Fix a bug introduced in Synapse 1.54.0 that broke background updates on sqlite homeservers while search was disabled. ([\#12215](https://github.com/matrix-org/synapse/issues/12215))
- Fix a long-standing bug when a `filter` argument with `event_fields` which did not include the `unsigned` field could result in a 500 error on `/sync`. ([\#12234](https://github.com/matrix-org/synapse/issues/12234))
Improved Documentation
----------------------
- Fix complexity checking config example in [Resource Constrained Devices](https://matrix-org.github.io/synapse/v1.54/other/running_synapse_on_single_board_computers.html) docs page. ([\#11998](https://github.com/matrix-org/synapse/issues/11998))
- Improve documentation for demo scripts. ([\#12143](https://github.com/matrix-org/synapse/issues/12143))
- Updates to the Room DAG concepts development document. ([\#12179](https://github.com/matrix-org/synapse/issues/12179))
- Document that the `typing`, `to_device`, `account_data`, `receipts`, and `presence` stream writer can only be used on a single worker. ([\#12196](https://github.com/matrix-org/synapse/issues/12196))
- Document that contributors can sign off privately by email. ([\#12204](https://github.com/matrix-org/synapse/issues/12204))
Deprecations and Removals
-------------------------
- **Remove workaround introduced in Synapse 1.50.0 for Mjolnir compatibility. Breaks compatibility with Mjolnir 1.3.1 and earlier. ([\#11700](https://github.com/matrix-org/synapse/issues/11700))**
- Remove backwards compatibilty with pagination tokens from the `/relations` and `/aggregations` endpoints generated from Synapse < v1.52.0. ([\#12138](https://github.com/matrix-org/synapse/issues/12138))
- The groups/communities feature in Synapse has been deprecated. ([\#12200](https://github.com/matrix-org/synapse/issues/12200))
Internal Changes
----------------
- Simplify the `ApplicationService` class' set of public methods related to interest checking. ([\#11915](https://github.com/matrix-org/synapse/issues/11915))
- Add config settings for background update parameters. ([\#11980](https://github.com/matrix-org/synapse/issues/11980))
- Correct type hints for txredis. ([\#12042](https://github.com/matrix-org/synapse/issues/12042))
- Limit the size of `aggregation_key` on annotations. ([\#12101](https://github.com/matrix-org/synapse/issues/12101))
- Add type hints to tests files. ([\#12108](https://github.com/matrix-org/synapse/issues/12108), [\#12146](https://github.com/matrix-org/synapse/issues/12146), [\#12207](https://github.com/matrix-org/synapse/issues/12207), [\#12208](https://github.com/matrix-org/synapse/issues/12208))
- Move scripts to Synapse package and expose as setuptools entry points. ([\#12118](https://github.com/matrix-org/synapse/issues/12118))
- Add support for cancellation to `ReadWriteLock`. ([\#12120](https://github.com/matrix-org/synapse/issues/12120))
- Fix data validation to compare to lists, not sequences. ([\#12128](https://github.com/matrix-org/synapse/issues/12128))
- Fix CI not attaching source distributions and wheels to the GitHub releases. ([\#12131](https://github.com/matrix-org/synapse/issues/12131))
- Remove unused mocks from `test_typing`. ([\#12136](https://github.com/matrix-org/synapse/issues/12136))
- Give `scripts-dev` scripts suffixes for neater CI config. ([\#12137](https://github.com/matrix-org/synapse/issues/12137))
- Move `synctl` into `synapse._scripts` and expose as an entry point. ([\#12140](https://github.com/matrix-org/synapse/issues/12140))
- Move the snapcraft configuration file to `contrib`. ([\#12142](https://github.com/matrix-org/synapse/issues/12142))
- Enable [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) Complement tests in CI. ([\#12144](https://github.com/matrix-org/synapse/issues/12144))
- Enable [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) Complement tests in CI. ([\#12145](https://github.com/matrix-org/synapse/issues/12145))
- Add test for `ObservableDeferred`'s cancellation behaviour. ([\#12149](https://github.com/matrix-org/synapse/issues/12149))
- Use `ParamSpec` in type hints for `synapse.logging.context`. ([\#12150](https://github.com/matrix-org/synapse/issues/12150))
- Prune unused jobs from `tox` config. ([\#12152](https://github.com/matrix-org/synapse/issues/12152))
- Move CI checks out of tox, to facilitate a move to using poetry. ([\#12153](https://github.com/matrix-org/synapse/issues/12153))
- Avoid generating state groups for local out-of-band leaves. ([\#12154](https://github.com/matrix-org/synapse/issues/12154))
- Avoid trying to calculate the state at outlier events. ([\#12155](https://github.com/matrix-org/synapse/issues/12155), [\#12173](https://github.com/matrix-org/synapse/issues/12173), [\#12202](https://github.com/matrix-org/synapse/issues/12202))
- Fix some type annotations. ([\#12156](https://github.com/matrix-org/synapse/issues/12156))
- Add type hints for `ObservableDeferred` attributes. ([\#12159](https://github.com/matrix-org/synapse/issues/12159))
- Use a prebuilt Action for the `tests-done` CI job. ([\#12161](https://github.com/matrix-org/synapse/issues/12161))
- Reduce number of DB queries made during processing of `/sync`. ([\#12163](https://github.com/matrix-org/synapse/issues/12163))
- Add `delay_cancellation` utility function, which behaves like `stop_cancellation` but waits until the original `Deferred` resolves before raising a `CancelledError`. ([\#12180](https://github.com/matrix-org/synapse/issues/12180))
- Retry HTTP replication failures, this should prevent 502's when restarting stateful workers (main, event persisters, stream writers). Contributed by Nick @ Beeper. ([\#12182](https://github.com/matrix-org/synapse/issues/12182))
- Add cancellation support to `@cached` and `@cachedList` decorators. ([\#12183](https://github.com/matrix-org/synapse/issues/12183))
- Remove unused variables. ([\#12187](https://github.com/matrix-org/synapse/issues/12187))
- Add combined test for HTTP pusher and push rule. Contributed by Nick @ Beeper. ([\#12188](https://github.com/matrix-org/synapse/issues/12188))
- Rename `HomeServer.get_tcp_replication` to `get_replication_command_handler`. ([\#12192](https://github.com/matrix-org/synapse/issues/12192))
- Remove some dead code. ([\#12197](https://github.com/matrix-org/synapse/issues/12197))
- Fix a misleading comment in the function `check_event_for_spam`. ([\#12203](https://github.com/matrix-org/synapse/issues/12203))
- Remove unnecessary `pass` statements. ([\#12206](https://github.com/matrix-org/synapse/issues/12206))
- Update the SSO username picker template to comply with SIWA guidelines. ([\#12210](https://github.com/matrix-org/synapse/issues/12210))
- Improve code documentation for the typing stream over replication. ([\#12211](https://github.com/matrix-org/synapse/issues/12211))
Synapse 1.54.0 (2022-03-08) Synapse 1.54.0 (2022-03-08)
=========================== ===========================

View File

@ -1 +0,0 @@
Remove workaround introduced in Synapse 1.50.0 for Mjolnir compatibility. Breaks compatibility with Mjolnir 1.3.1 and earlier.

View File

@ -1 +0,0 @@
Simplify the `ApplicationService` class' set of public methods related to interest checking.

View File

@ -1 +0,0 @@
Add config settings for background update parameters.

View File

@ -1 +0,0 @@
Fix complexity checking config example in [Resource Constrained Devices](https://matrix-org.github.io/synapse/v1.54/other/running_synapse_on_single_board_computers.html) docs page.

View File

@ -1 +0,0 @@
Add third-party rules rules callbacks `check_can_shutdown_room` and `check_can_deactivate_user`.

View File

@ -1 +0,0 @@
Correct type hints for txredis.

View File

@ -1 +0,0 @@
Use the proper serialization format for bundled thread aggregations. The bug has existed since Synapse v1.48.0.

View File

@ -1 +0,0 @@
Limit the size of `aggregation_key` on annotations.

View File

@ -1 +0,0 @@
Add type hints to tests files.

View File

@ -1 +0,0 @@
Fix a long-standing bug when redacting events with relations.

View File

@ -1 +0,0 @@
Move scripts to Synapse package and expose as setuptools entry points.

View File

@ -1 +0,0 @@
Add support for cancellation to `ReadWriteLock`.

View File

@ -1 +0,0 @@
Fix a long-standing bug when redacting events with relations.

View File

@ -1 +0,0 @@
Fix data validation to compare to lists, not sequences.

View File

@ -1 +0,0 @@
Fix a long-standing bug when redacting events with relations.

View File

@ -1 +0,0 @@
Fix CI not attaching source distributions and wheels to the GitHub releases.

View File

@ -1 +0,0 @@
Improve performance of logging in for large accounts.

View File

@ -1 +0,0 @@
Add experimental env var `SYNAPSE_ASYNC_IO_REACTOR` that causes Synapse to use the asyncio reactor for Twisted.

View File

@ -1 +0,0 @@
Remove unused mocks from `test_typing`.

View File

@ -1 +0,0 @@
Give `scripts-dev` scripts suffixes for neater CI config.

View File

@ -1 +0,0 @@
Remove backwards compatibilty with pagination tokens from the `/relations` and `/aggregations` endpoints generated from Synapse < v1.52.0.

View File

@ -1 +0,0 @@
Move `synctl` into `synapse._scripts` and expose as an entry point.

View File

@ -1 +0,0 @@
Move the snapcraft configuration file to `contrib`.

View File

@ -1 +0,0 @@
Improve documentation for demo scripts.

View File

@ -1 +0,0 @@
Enable [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) Complement tests in CI.

View File

@ -1 +0,0 @@
Enable [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) Complement tests in CI.

View File

@ -1 +0,0 @@
Add type hints to tests files.

View File

@ -1 +0,0 @@
Add test for `ObservableDeferred`'s cancellation behaviour.

View File

@ -1 +0,0 @@
Use `ParamSpec` in type hints for `synapse.logging.context`.

View File

@ -1 +0,0 @@
Support the stable identifiers from [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440): threads.

View File

@ -1 +0,0 @@
Prune unused jobs from `tox` config.

View File

@ -1 +0,0 @@
Move CI checks out of tox, to facilitate a move to using poetry.

View File

@ -1 +0,0 @@
Avoid generating state groups for local out-of-band leaves.

View File

@ -1 +0,0 @@
Avoid trying to calculate the state at outlier events.

View File

@ -1 +0,0 @@
Fix some type annotations.

View File

@ -1 +0,0 @@
Fix a bug introduced in #4864 whereby background updates are never run with the default background batch size.

View File

@ -1 +0,0 @@
Add type hints for `ObservableDeferred` attributes.

View File

@ -1 +0,0 @@
Use a prebuilt Action for the `tests-done` CI job.

View File

@ -1 +0,0 @@
Reduce number of DB queries made during processing of `/sync`.

View File

@ -1 +0,0 @@
Avoid trying to calculate the state at outlier events.

View File

@ -1 +0,0 @@
Fix a bug where non-standard information was returned from the `/hierarchy` API. Introduced in Synapse v1.41.0.

View File

@ -1 +0,0 @@
Updates to the Room DAG concepts development document.

View File

@ -1 +0,0 @@
Add `delay_cancellation` utility function, which behaves like `stop_cancellation` but waits until the original `Deferred` resolves before raising a `CancelledError`.

View File

@ -1 +0,0 @@
Retry HTTP replication failures, this should prevent 502's when restarting stateful workers (main, event persisters, stream writers). Contributed by Nick @ Beeper.

View File

@ -1 +0,0 @@
Add cancellation support to `@cached` and `@cachedList` decorators.

View File

@ -1 +0,0 @@
Remove unused variables.

View File

@ -1 +0,0 @@
Add combined test for HTTP pusher and push rule. Contributed by Nick @ Beeper.

View File

@ -1 +0,0 @@
Fix a long-standing bug when redacting events with relations.

View File

@ -1 +0,0 @@
Rename `HomeServer.get_tcp_replication` to `get_replication_command_handler`.

View File

@ -1 +0,0 @@
Document that the `typing`, `to_device`, `account_data`, `receipts`, and `presence` stream writer can only be used on a single worker.

View File

@ -1 +0,0 @@
Remove some dead code.

View File

@ -1 +0,0 @@
The groups/communities feature in Synapse has been deprecated.

View File

@ -1 +0,0 @@
Avoid trying to calculate the state at outlier events.

View File

@ -1 +0,0 @@
Fix a misleading comment in the function `check_event_for_spam`.

View File

@ -1 +0,0 @@
Document that contributors can sign off privately by email.

View File

@ -1 +0,0 @@
Remove unnecessary `pass` statements.

View File

@ -1 +0,0 @@
Add type hints to tests files.

View File

@ -1 +0,0 @@
Add type hints to tests files.

View File

@ -1 +0,0 @@
Update the SSO username picker template to comply with SIWA guidelines.

View File

@ -1 +0,0 @@
Improve code documentation for the typing stream over replication.

View File

@ -1 +0,0 @@
Add a new Jinja2 template filter to extract the local part of an email address.

View File

@ -1 +0,0 @@
Fix a bug introduced in 1.54.0 that broke background updates on sqlite homeservers while search was disabled.

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
matrix-synapse-py3 (1.55.0~rc1) stable; urgency=medium
* New synapse release 1.55.0~rc1.
-- Synapse Packaging team <packages@matrix.org> Tue, 15 Mar 2022 10:59:31 +0000
matrix-synapse-py3 (1.54.0) stable; urgency=medium matrix-synapse-py3 (1.54.0) stable; urgency=medium
* New synapse release 1.54.0. * New synapse release 1.54.0.

View File

@ -68,7 +68,7 @@ try:
except ImportError: except ImportError:
pass pass
__version__ = "1.54.0" __version__ = "1.55.0rc1"
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)): if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
# We import here so that we don't have to install a bunch of deps when # We import here so that we don't have to install a bunch of deps when

View File

@ -530,9 +530,12 @@ class EventClientSerializer:
# Include the bundled aggregations in the event. # Include the bundled aggregations in the event.
if serialized_aggregations: if serialized_aggregations:
serialized_event["unsigned"].setdefault("m.relations", {}).update( # There is likely already an "unsigned" field, but a filter might
serialized_aggregations # have stripped it off (via the event_fields option). The server is
) # allowed to return additional fields, so add it back.
serialized_event.setdefault("unsigned", {}).setdefault(
"m.relations", {}
).update(serialized_aggregations)
def serialize_events( def serialize_events(
self, self,

View File

@ -981,6 +981,34 @@ class RelationsTestCase(BaseRelationsTestCase):
[annotation_event_id_good, thread_event_id], [annotation_event_id_good, thread_event_id],
) )
def test_bundled_aggregations_with_filter(self) -> None:
"""
If "unsigned" is an omitted field (due to filtering), adding the bundled
aggregations should not break.
Note that the spec allows for a server to return additional fields beyond
what is specified.
"""
self._send_relation(RelationTypes.ANNOTATION, "m.reaction", "a")
# Note that the sync filter does not include "unsigned" as a field.
filter = urllib.parse.quote_plus(
b'{"event_fields": ["content", "event_id"], "room": {"timeline": {"limit": 3}}}'
)
channel = self.make_request(
"GET", f"/sync?filter={filter}", access_token=self.user_token
)
self.assertEqual(200, channel.code, channel.json_body)
# Ensure the timeline is limited, find the parent event.
room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"]
self.assertTrue(room_timeline["limited"])
parent_event = self._find_event_in_chunk(room_timeline["events"])
# Ensure there's bundled aggregations on it.
self.assertIn("unsigned", parent_event)
self.assertIn("m.relations", parent_event["unsigned"])
class RelationPaginationTestCase(BaseRelationsTestCase): class RelationPaginationTestCase(BaseRelationsTestCase):
def test_basic_paginate_relations(self) -> None: def test_basic_paginate_relations(self) -> None: