Skip to content

Commit

Permalink
Merge branch 'develop' into shay/redact_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay authored Oct 7, 2024
2 parents b2f9ba4 + e8c8924 commit 19e4309
Show file tree
Hide file tree
Showing 79 changed files with 2,856 additions and 367 deletions.
79 changes: 79 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
# Synapse 1.116.0 (2024-10-01)

No significant changes since 1.116.0rc2.




# Synapse 1.116.0rc2 (2024-09-26)

### Features

- Add implementation of restricting who can overwrite a state event as proposed by [MSC3757](https://github.com/matrix-org/matrix-spec-proposals/pull/3757). ([\#17513](https://github.com/element-hq/synapse/issues/17513))




# Synapse 1.116.0rc1 (2024-09-25)

### Features

- Add initial implementation of delayed events as proposed by [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140). ([\#17326](https://github.com/element-hq/synapse/issues/17326))
- Add an asynchronous Admin API endpoint [to redact all a user's events](https://element-hq.github.io/synapse/v1.116/admin_api/user_admin_api.html#redact-all-the-events-of-a-user),
and [an endpoint to check on the status of that redaction task](https://element-hq.github.io/synapse/v1.116/admin_api/user_admin_api.html#check-the-status-of-a-redaction-process). ([\#17506](https://github.com/element-hq/synapse/issues/17506))
- Add support for the `tags` and `not_tags` filters for [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync. ([\#17662](https://github.com/element-hq/synapse/issues/17662))
- Guests can use the new media endpoints to download media, as described by [MSC4189](https://github.com/matrix-org/matrix-spec-proposals/pull/4189). ([\#17675](https://github.com/element-hq/synapse/issues/17675))
- Add config option `turn_shared_secret_path`. ([\#17690](https://github.com/element-hq/synapse/issues/17690))
- Return room tags in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync account data extension. ([\#17707](https://github.com/element-hq/synapse/issues/17707))

### Bugfixes

- Make sure we get up-to-date state information when using the new [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync tables to derive room membership. ([\#17692](https://github.com/element-hq/synapse/issues/17692))
- Fix bug where room account data would not correctly be sent down [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync for old rooms. ([\#17695](https://github.com/element-hq/synapse/issues/17695))
- Fix a bug in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync which could prevent /sync from working for certain user accounts. ([\#17727](https://github.com/element-hq/synapse/issues/17727), [\#17733](https://github.com/element-hq/synapse/issues/17733))
- Ignore invites from ignored users in Sliding Sync. ([\#17729](https://github.com/element-hq/synapse/issues/17729))
- Fix bug in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync where the server would incorrectly return a negative bump stamp, which caused Element X apps to stop syncing. ([\#17748](https://github.com/element-hq/synapse/issues/17748))

### Internal Changes

- Import pydantic objects from the `_pydantic_compat` module.
This allows `check_pydantic_models.py` to mock those pydantic objects
only in the synapse module, and not interfere with pydantic objects in
external dependencies. ([\#17667](https://github.com/element-hq/synapse/issues/17667))
- Use [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync tables as a bulk shortcut for getting the max `event_stream_ordering` of rooms. ([\#17693](https://github.com/element-hq/synapse/issues/17693))
- Speed up [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) sliding sync requests a bit where there are many room changes. ([\#17696](https://github.com/element-hq/synapse/issues/17696))
- Refactor [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) sliding sync filter unit tests so the sliding sync API has better test coverage. ([\#17703](https://github.com/element-hq/synapse/issues/17703))
- Fetch `bump_stamp`s more efficiently in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync. ([\#17723](https://github.com/element-hq/synapse/issues/17723))
- Shortcut for checking if certain background updates have completed (utilized in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync). ([\#17724](https://github.com/element-hq/synapse/issues/17724))
- More efficiently fetch rooms for [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync. ([\#17725](https://github.com/element-hq/synapse/issues/17725))
- Fix `_bulk_get_max_event_pos` being inefficient. ([\#17728](https://github.com/element-hq/synapse/issues/17728))
- Add cache to `get_tags_for_room(...)`. ([\#17730](https://github.com/element-hq/synapse/issues/17730))
- Small performance improvement in speeding up [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) Sliding Sync. ([\#17731](https://github.com/element-hq/synapse/issues/17731))
- Minor speed up of initial [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186) sliding sync requests. ([\#17734](https://github.com/element-hq/synapse/issues/17734))
- Remove usage of the deprecated `cgi` module, deprecated in Python 3.11 and removed in Python 3.13. ([\#17741](https://github.com/element-hq/synapse/issues/17741))
- Fix typing of a variable that is not `Unknown` anymore after updating `treq`. ([\#17744](https://github.com/element-hq/synapse/issues/17744))



### Updates to locked dependencies

* Bump anyhow from 1.0.86 to 1.0.89. ([\#17685](https://github.com/element-hq/synapse/issues/17685), [\#17716](https://github.com/element-hq/synapse/issues/17716))
* Bump bytes from 1.7.1 to 1.7.2. ([\#17743](https://github.com/element-hq/synapse/issues/17743))
* Bump cryptography from 43.0.0 to 43.0.1. ([\#17689](https://github.com/element-hq/synapse/issues/17689))
* Bump idna from 3.8 to 3.10. ([\#17758](https://github.com/element-hq/synapse/issues/17758))
* Bump msgpack from 1.0.8 to 1.1.0. ([\#17759](https://github.com/element-hq/synapse/issues/17759))
* Bump phonenumbers from 8.13.44 to 8.13.45. ([\#17762](https://github.com/element-hq/synapse/issues/17762))
* Bump prometheus-client from 0.20.0 to 0.21.0. ([\#17746](https://github.com/element-hq/synapse/issues/17746))
* Bump pyasn1 from 0.6.0 to 0.6.1. ([\#17714](https://github.com/element-hq/synapse/issues/17714))
* Bump pyasn1-modules from 0.4.0 to 0.4.1. ([\#17747](https://github.com/element-hq/synapse/issues/17747))
* Bump pydantic from 2.8.2 to 2.9.2. ([\#17756](https://github.com/element-hq/synapse/issues/17756))
* Bump python-multipart from 0.0.9 to 0.0.10. ([\#17745](https://github.com/element-hq/synapse/issues/17745))
* Bump ruff from 0.6.4 to 0.6.7. ([\#17715](https://github.com/element-hq/synapse/issues/17715), [\#17760](https://github.com/element-hq/synapse/issues/17760))
* Bump sentry-sdk from 2.13.0 to 2.14.0. ([\#17712](https://github.com/element-hq/synapse/issues/17712))
* Bump serde from 1.0.209 to 1.0.210. ([\#17686](https://github.com/element-hq/synapse/issues/17686))
* Bump serde_json from 1.0.127 to 1.0.128. ([\#17687](https://github.com/element-hq/synapse/issues/17687))
* Bump treq from 23.11.0 to 24.9.1. ([\#17744](https://github.com/element-hq/synapse/issues/17744))
* Bump types-pyyaml from 6.0.12.20240808 to 6.0.12.20240917. ([\#17755](https://github.com/element-hq/synapse/issues/17755))
* Bump types-requests from 2.32.0.20240712 to 2.32.0.20240914. ([\#17713](https://github.com/element-hq/synapse/issues/17713))
* Bump types-setuptools from 74.1.0.20240907 to 75.1.0.20240917. ([\#17757](https://github.com/element-hq/synapse/issues/17757))

# Synapse 1.115.0 (2024-09-17)

No significant changes since 1.115.0rc2.
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions changelog.d/17506.feature

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/17628.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the docstring of `test_forget_when_not_left`.
1 change: 0 additions & 1 deletion changelog.d/17662.feature

This file was deleted.

5 changes: 0 additions & 5 deletions changelog.d/17667.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17675.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17690.feature

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17692.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17693.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17695.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17696.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17703.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17707.feature

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/17709.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation note about PYTHONMALLOC for accurate jemalloc memory tracking. Contributed by @hensg.
1 change: 1 addition & 0 deletions changelog.d/17717.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add config option `redis.password_path`.
1 change: 0 additions & 1 deletion changelog.d/17723.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17724.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17725.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17727.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17728.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17729.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17730.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17731.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/17733.bugfix

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/17749.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove spurious "TODO UPDATE ALL THIS" note in the Debian installation docs.
1 change: 1 addition & 0 deletions changelog.d/17751.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minor performance increase for large accounts using sliding sync.
1 change: 1 addition & 0 deletions changelog.d/17765.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase performance of the notifier when there are many syncing users.
1 change: 1 addition & 0 deletions changelog.d/17766.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase performance of the notifier when there are many syncing users.
1 change: 1 addition & 0 deletions changelog.d/17767.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix performance of streams that don't change often.
1 change: 1 addition & 0 deletions changelog.d/17768.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve performance of sliding sync connections that do not ask for any rooms.
1 change: 1 addition & 0 deletions changelog.d/17771.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce overhead of sliding sync E2EE loops.
1 change: 1 addition & 0 deletions changelog.d/17776.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Explain how load balancing works for `federation_sender_instances`.
1 change: 1 addition & 0 deletions changelog.d/17779.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a rare bug introduced in v1.29.0 where invalidating a user's access token from a worker could raise an error.
1 change: 1 addition & 0 deletions changelog.d/17780.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In the response to `GET /_matrix/client/versions`, set the `unstable_features` flag for MSC4140 to `false` when server configuration disables support for delayed events.
4 changes: 2 additions & 2 deletions contrib/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#

import argparse
import cgi
import datetime
import html
import json
import urllib.request
from typing import List
Expand Down Expand Up @@ -85,7 +85,7 @@ def make_graph(pdus: List[dict], filename_prefix: str) -> None:
"name": name,
"type": pdu.get("pdu_type"),
"state_key": pdu.get("state_key"),
"content": cgi.escape(json.dumps(pdu.get("content")), quote=True),
"content": html.escape(json.dumps(pdu.get("content")), quote=True),
"time": t,
"depth": pdu.get("depth"),
}
Expand Down
18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
matrix-synapse-py3 (1.116.0) stable; urgency=medium

* New Synapse release 1.116.0.

-- Synapse Packaging team <packages@matrix.org> Tue, 01 Oct 2024 11:14:07 +0100

matrix-synapse-py3 (1.116.0~rc2) stable; urgency=medium

* New synapse release 1.116.0rc2.

-- Synapse Packaging team <packages@matrix.org> Thu, 26 Sep 2024 13:28:43 +0000

matrix-synapse-py3 (1.116.0~rc1) stable; urgency=medium

* New synapse release 1.116.0rc1.

-- Synapse Packaging team <packages@matrix.org> Wed, 25 Sep 2024 09:34:07 +0000

matrix-synapse-py3 (1.115.0) stable; urgency=medium

* New Synapse release 1.115.0.
Expand Down
3 changes: 3 additions & 0 deletions docker/complement/conf/workers-shared-extra.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ server_notices:
system_mxid_avatar_url: ""
room_name: "Server Alert"

# Enable delayed events (msc4140)
max_event_delay_duration: 24h


# Disable sync cache so that initial `/sync` requests are up-to-date.
caches:
Expand Down
8 changes: 3 additions & 5 deletions docs/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ architecture via <https://packages.matrix.org/debian/>.

To install the latest release:

TODO UPDATE ALL THIS

```sh
sudo apt install -y lsb-release wget apt-transport-https
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
Expand Down Expand Up @@ -316,7 +314,7 @@ sudo dnf group install "Development Tools"

*Note: The term "RHEL" below refers to both Red Hat Enterprise Linux and Rocky Linux. The distributions are 1:1 binary compatible.*

It's recommended to use the latest Python versions.
It's recommended to use the latest Python versions.

RHEL 8 in particular ships with Python 3.6 by default which is EOL and therefore no longer supported by Synapse. RHEL 9 ship with Python 3.9 which is still supported by the Python core team as of this writing. However, newer Python versions provide significant performance improvements and they're available in official distributions' repositories. Therefore it's recommended to use them.

Expand Down Expand Up @@ -346,7 +344,7 @@ dnf install python3.12 python3.12-devel
```
Finally, install common prerequisites
```bash
dnf install libicu libicu-devel libpq5 libpq5-devel lz4 pkgconf
dnf install libicu libicu-devel libpq5 libpq5-devel lz4 pkgconf
dnf group install "Development Tools"
```
###### Using venv module instead of virtualenv command
Expand All @@ -355,7 +353,7 @@ It's recommended to use Python venv module directly rather than the virtualenv c
* On RHEL 9, virtualenv is only available on [EPEL](https://docs.fedoraproject.org/en-US/epel/).
* On RHEL 8, virtualenv is based on Python 3.6. It does not support creating 3.11/3.12 virtual environments.

Here's an example of creating Python 3.12 virtual environment and installing Synapse from PyPI.
Here's an example of creating Python 3.12 virtual environment and installing Synapse from PyPI.

```bash
mkdir -p ~/synapse
Expand Down
2 changes: 2 additions & 0 deletions docs/usage/administration/admin_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ line to `/etc/default/matrix-synapse`:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

*Note*: You may need to set `PYTHONMALLOC=malloc` to ensure that `jemalloc` can accurately calculate memory usage. By default, Python uses its internal small-object allocator, which may interfere with jemalloc's ability to track memory consumption correctly. This could prevent the [cache_autotuning](../configuration/config_documentation.md#caches-and-associated-values) feature from functioning as expected, as the Python allocator may not reach the memory threshold set by `max_cache_memory_usage`, thus not triggering the cache eviction process.

This made a significant difference on Python 2.7 - it's unclear how
much of an improvement it provides on Python 3.x.

Expand Down
29 changes: 27 additions & 2 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,19 @@ email:
password_reset: "[%(server_name)s] Password reset"
email_validation: "[%(server_name)s] Validate your email"
```
---
### `max_event_delay_duration`

The maximum allowed duration by which sent events can be delayed, as per
[MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140).
Must be a positive value if set.

Defaults to no duration (`null`), which disallows sending delayed events.

Example configuration:
```yaml
max_event_delay_duration: 24h
```

## Homeserver blocking
Useful options for Synapse admins.
Expand Down Expand Up @@ -4355,7 +4368,13 @@ It is possible to scale the processes that handle sending outbound federation re
by running a [`generic_worker`](../../workers.md#synapseappgeneric_worker) and adding it's [`worker_name`](#worker_name) to
a `federation_sender_instances` map. Doing so will remove handling of this function from
the main process. Multiple workers can be added to this map, in which case the work is
balanced across them.
balanced across them.

The way that the load balancing works is any outbound federation request will be assigned
to a federation sender worker based on the hash of the destination server name. This
means that all requests being sent to the same destination will be processed by the same
worker instance. Multiple `federation_sender_instances` are useful if there is a federation
with multiple servers.

This configuration setting must be shared between all workers handling federation
sending, and if changed all federation sender workers must be stopped at the same time
Expand Down Expand Up @@ -4505,6 +4524,9 @@ This setting has the following sub-options:
* `path`: The full path to a local Unix socket file. **If this is used, `host` and
`port` are ignored.** Defaults to `/tmp/redis.sock'
* `password`: Optional password if configured on the Redis instance.
* `password_path`: Alternative to `password`, reading the password from an
external file. The file should be a plain text file, containing only the
password. Synapse reads the password from the given file once at startup.
* `dbid`: Optional redis dbid if needs to connect to specific redis logical db.
* `use_tls`: Whether to use tls connection. Defaults to false.
* `certificate_file`: Optional path to the certificate file
Expand All @@ -4518,13 +4540,16 @@ This setting has the following sub-options:

_Changed in Synapse 1.85.0: Added path option to use a local Unix socket_

_Changed in Synapse 1.116.0: Added password\_path_

Example configuration:
```yaml
redis:
enabled: true
host: localhost
port: 6379
password: <secret_password>
password_path: <path_to_the_password_file>
# OR password: <secret_password>
dbid: <dbid>
#use_tls: True
#certificate_file: <path_to_the_certificate_file>
Expand Down
1 change: 1 addition & 0 deletions docs/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ information.
Additionally, the following REST endpoints can be handled for GET requests:

^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
^/_matrix/client/unstable/org.matrix.msc4140/delayed_events

Pagination requests can also be handled, but all requests for a given
room must be routed to the same instance. Additionally, care must be taken to
Expand Down
Loading

0 comments on commit 19e4309

Please sign in to comment.