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

Commit 14656fe

Browse files
committed
Merge tag 'v1.43.0' into babolivier/dinsic_1.48.0
2 parents 1f5829d + 9ffa787 commit 14656fe

File tree

185 files changed

+4208
-2480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+4208
-2480
lines changed

.ci/worker-blacklist

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
11
# This file serves as a blacklist for SyTest tests that we expect will fail in
22
# Synapse when run under worker mode. For more details, see sytest-blacklist.
3-
4-
Can re-join room if re-invited
5-
6-
# new failures as of https://github.com/matrix-org/sytest/pull/732
7-
Device list doesn't change if remote server is down
8-
9-
# https://buildkite.com/matrix-dot-org/synapse/builds/6134#6f67bf47-e234-474d-80e8-c6e1868b15c5
10-
Server correctly handles incoming m.device_list_update

CHANGES.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
Synapse 1.43.0 (2021-09-21)
2+
===========================
3+
4+
This release drops support for the deprecated, unstable API for [MSC2858 (Multiple SSO Identity Providers)](https://github.com/matrix-org/matrix-doc/blob/master/proposals/2858-Multiple-SSO-Identity-Providers.md#unstable-prefix), as well as the undocumented `experimental.msc2858_enabled` config option. Client authors should update their clients to use the stable API, available since Synapse 1.30.
5+
6+
The documentation has been updated with configuration for routing `/spaces`, `/hierarchy` and `/summary` to workers. See [the upgrade notes](https://github.com/matrix-org/synapse/blob/release-v1.43/docs/upgrade.md#upgrading-to-v1430) for more details.
7+
8+
No significant changes since 1.43.0rc2.
9+
10+
Synapse 1.43.0rc2 (2021-09-17)
11+
==============================
12+
13+
Bugfixes
14+
--------
15+
16+
- Added opentracing logging to help debug [\#9424](https://github.com/matrix-org/synapse/issues/9424). ([\#10828](https://github.com/matrix-org/synapse/issues/10828))
17+
18+
19+
Synapse 1.43.0rc1 (2021-09-14)
20+
==============================
21+
22+
Features
23+
--------
24+
25+
- Allow room creators to send historical events specified by [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) in existing room versions. ([\#10566](https://github.com/matrix-org/synapse/issues/10566))
26+
- Add config option to use non-default manhole password and keys. ([\#10643](https://github.com/matrix-org/synapse/issues/10643))
27+
- Skip final GC at shutdown to improve restart performance. ([\#10712](https://github.com/matrix-org/synapse/issues/10712))
28+
- Allow configuration of the oEmbed URLs used for URL previews. ([\#10714](https://github.com/matrix-org/synapse/issues/10714), [\#10759](https://github.com/matrix-org/synapse/issues/10759))
29+
- Prefer [room version 9](https://github.com/matrix-org/matrix-doc/pull/3375) for restricted rooms per the [room version capabilities](https://github.com/matrix-org/matrix-doc/pull/3244) API. ([\#10772](https://github.com/matrix-org/synapse/issues/10772))
30+
31+
32+
Bugfixes
33+
--------
34+
35+
- Fix a long-standing bug where room avatars were not included in email notifications. ([\#10658](https://github.com/matrix-org/synapse/issues/10658))
36+
- Fix a bug where the ordering algorithm was skipping the `origin_server_ts` step in the spaces summary resulting in unstable room orderings. ([\#10730](https://github.com/matrix-org/synapse/issues/10730))
37+
- Fix edge case when persisting events into a room where there are multiple events we previously hadn't calculated auth chains for (and hadn't marked as needing to be calculated). ([\#10743](https://github.com/matrix-org/synapse/issues/10743))
38+
- Fix a bug which prevented calls to `/createRoom` that included the `room_alias_name` parameter from being handled by worker processes. ([\#10757](https://github.com/matrix-org/synapse/issues/10757))
39+
- Fix a bug which prevented user registration via SSO to require consent tracking for SSO mapping providers that don't prompt for Matrix ID selection. Contributed by @AndrewFerr. ([\#10733](https://github.com/matrix-org/synapse/issues/10733))
40+
- Only return the stripped state events for the `m.space.child` events in a room for the spaces summary from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). ([\#10760](https://github.com/matrix-org/synapse/issues/10760))
41+
- Properly handle room upgrades of spaces. ([\#10774](https://github.com/matrix-org/synapse/issues/10774))
42+
- Fix a bug which generated invalid homeserver config when the `frontend_proxy` worker type was passed to the Synapse Worker-based Complement image. ([\#10783](https://github.com/matrix-org/synapse/issues/10783))
43+
44+
45+
Improved Documentation
46+
----------------------
47+
48+
- Minor fix to the `media_repository` developer documentation. Contributed by @cuttingedge1109. ([\#10556](https://github.com/matrix-org/synapse/issues/10556))
49+
- Update the documentation to note that the `/spaces` and `/hierarchy` endpoints can be routed to workers. ([\#10648](https://github.com/matrix-org/synapse/issues/10648))
50+
- Clarify admin API documentation on undoing room deletions. ([\#10735](https://github.com/matrix-org/synapse/issues/10735))
51+
- Split up the modules documentation and add examples for module developers. ([\#10758](https://github.com/matrix-org/synapse/issues/10758))
52+
- Correct 2 typographical errors in the [Log Contexts documentation](https://matrix-org.github.io/synapse/latest/log_contexts.html). ([\#10795](https://github.com/matrix-org/synapse/issues/10795))
53+
- Fix a wording mistake in the sample configuration. Contributed by @bramvdnheuvel:nltrix.net. ([\#10804](https://github.com/matrix-org/synapse/issues/10804))
54+
55+
56+
Deprecations and Removals
57+
-------------------------
58+
59+
- Remove the [unstable MSC2858 API](https://github.com/matrix-org/matrix-doc/blob/master/proposals/2858-Multiple-SSO-Identity-Providers.md#unstable-prefix), including the undocumented `experimental.msc2858_enabled` config option. The unstable API has been deprecated since Synapse 1.35. Client authors should update their clients to use the stable API introduced in Synapse 1.30 if they have not already done so. ([\#10693](https://github.com/matrix-org/synapse/issues/10693))
60+
61+
62+
Internal Changes
63+
----------------
64+
65+
- Add OpenTracing logging to help debug stuck messages (as described by issue [#9424](https://github.com/matrix-org/synapse/issues/9424)). ([\#10704](https://github.com/matrix-org/synapse/issues/10704))
66+
- Add type annotations to the `synapse.util` package. ([\#10601](https://github.com/matrix-org/synapse/issues/10601))
67+
- Ensure `rooms.creator` field is always populated for easy lookup in [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) usage later. ([\#10697](https://github.com/matrix-org/synapse/issues/10697))
68+
- Add missing type hints to REST servlets. ([\#10707](https://github.com/matrix-org/synapse/issues/10707), [\#10728](https://github.com/matrix-org/synapse/issues/10728), [\#10736](https://github.com/matrix-org/synapse/issues/10736))
69+
- Do not include rooms with unknown room versions in the spaces summary results. ([\#10727](https://github.com/matrix-org/synapse/issues/10727))
70+
- Additional error checking for the `preset` field when creating a room. ([\#10738](https://github.com/matrix-org/synapse/issues/10738))
71+
- Clean up some of the federation event authentication code for clarity. ([\#10744](https://github.com/matrix-org/synapse/issues/10744), [\#10745](https://github.com/matrix-org/synapse/issues/10745), [\#10746](https://github.com/matrix-org/synapse/issues/10746), [\#10771](https://github.com/matrix-org/synapse/issues/10771), [\#10773](https://github.com/matrix-org/synapse/issues/10773), [\#10781](https://github.com/matrix-org/synapse/issues/10781))
72+
- Add an index to `presence_stream` to hopefully speed up startups a little. ([\#10748](https://github.com/matrix-org/synapse/issues/10748))
73+
- Refactor event size checking code to simplify searching the codebase for the origins of certain error strings that are occasionally emitted. ([\#10750](https://github.com/matrix-org/synapse/issues/10750))
74+
- Move tests relating to rooms having encryption out of the user directory tests. ([\#10752](https://github.com/matrix-org/synapse/issues/10752))
75+
- Use `attrs` internally for the URL preview code & update documentation. ([\#10753](https://github.com/matrix-org/synapse/issues/10753))
76+
- Minor speed ups when joining large rooms over federation. ([\#10754](https://github.com/matrix-org/synapse/issues/10754), [\#10755](https://github.com/matrix-org/synapse/issues/10755), [\#10756](https://github.com/matrix-org/synapse/issues/10756), [\#10780](https://github.com/matrix-org/synapse/issues/10780), [\#10784](https://github.com/matrix-org/synapse/issues/10784))
77+
- Add a constant for `m.federate`. ([\#10775](https://github.com/matrix-org/synapse/issues/10775))
78+
- Add a script to update the Debian changelog in a Docker container for systems that are not Debian-based. ([\#10778](https://github.com/matrix-org/synapse/issues/10778))
79+
- Change the format of authenticated users in logs when a user is being puppeted by and admin user. ([\#10779](https://github.com/matrix-org/synapse/issues/10779))
80+
- Remove fixed and flakey tests from the Sytest blacklist. ([\#10788](https://github.com/matrix-org/synapse/issues/10788))
81+
- Improve internal details of the user directory code. ([\#10789](https://github.com/matrix-org/synapse/issues/10789))
82+
- Use direct references to config flags. ([\#10798](https://github.com/matrix-org/synapse/issues/10798))
83+
- Ensure the Rust reporter passes type checking with jaeger-client 4.7's type annotations. ([\#10799](https://github.com/matrix-org/synapse/issues/10799))
84+
85+
186
Synapse 1.42.0 (2021-09-07)
287
===========================
388

debian/changelog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
matrix-synapse-py3 (1.43.0) stable; urgency=medium
2+
3+
* New synapse release 1.43.0.
4+
5+
-- Synapse Packaging team <[email protected]> Tue, 21 Sep 2021 11:49:05 +0100
6+
7+
matrix-synapse-py3 (1.43.0~rc2) stable; urgency=medium
8+
9+
* New synapse release 1.43.0~rc2.
10+
11+
-- Synapse Packaging team <[email protected]> Fri, 17 Sep 2021 10:43:21 +0100
12+
13+
matrix-synapse-py3 (1.43.0~rc1) stable; urgency=medium
14+
15+
* New synapse release 1.43.0~rc1.
16+
17+
-- Synapse Packaging team <[email protected]> Tue, 14 Sep 2021 11:39:46 +0100
18+
119
matrix-synapse-py3 (1.42.0) stable; urgency=medium
220

321
* New synapse release 1.42.0.

docker/configure_workers_and_start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"shared_extra_conf": {},
163163
"worker_extra_conf": (
164164
"worker_main_http_uri: http://127.0.0.1:%d"
165-
% (MAIN_PROCESS_HTTP_LISTENER_PORT,),
165+
% (MAIN_PROCESS_HTTP_LISTENER_PORT,)
166166
),
167167
},
168168
}

docs/SUMMARY.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@
3434
- [Application Services](application_services.md)
3535
- [Server Notices](server_notices.md)
3636
- [Consent Tracking](consent_tracking.md)
37-
- [URL Previews](url_previews.md)
37+
- [URL Previews](development/url_previews.md)
3838
- [User Directory](user_directory.md)
3939
- [Message Retention Policies](message_retention_policies.md)
40-
- [Pluggable Modules](modules.md)
41-
- [Third Party Rules]()
42-
- [Spam Checker](spam_checker.md)
43-
- [Presence Router](presence_router_module.md)
44-
- [Media Storage Providers]()
40+
- [Pluggable Modules](modules/index.md)
41+
- [Writing a module](modules/writing_a_module.md)
42+
- [Spam checker callbacks](modules/spam_checker_callbacks.md)
43+
- [Third-party rules callbacks](modules/third_party_rules_callbacks.md)
44+
- [Presence router callbacks](modules/presence_router_callbacks.md)
45+
- [Account validity callbacks](modules/account_validity_callbacks.md)
46+
- [Porting a legacy module to the new interface](modules/porting_legacy_module.md)
4547
- [Workers](workers.md)
4648
- [Using `synctl` with Workers](synctl_workers.md)
4749
- [Systemd](systemd-with-workers/README.md)

docs/admin_api/rooms.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -481,32 +481,44 @@ The following fields are returned in the JSON response body:
481481
* `new_room_id` - A string representing the room ID of the new room.
482482

483483

484-
## Undoing room shutdowns
484+
## Undoing room deletions
485485

486-
*Note*: This guide may be outdated by the time you read it. By nature of room shutdowns being performed at the database level,
486+
*Note*: This guide may be outdated by the time you read it. By nature of room deletions being performed at the database level,
487487
the structure can and does change without notice.
488488

489-
First, it's important to understand that a room shutdown is very destructive. Undoing a shutdown is not as simple as pretending it
489+
First, it's important to understand that a room deletion is very destructive. Undoing a deletion is not as simple as pretending it
490490
never happened - work has to be done to move forward instead of resetting the past. In fact, in some cases it might not be possible
491491
to recover at all:
492492

493493
* If the room was invite-only, your users will need to be re-invited.
494494
* If the room no longer has any members at all, it'll be impossible to rejoin.
495-
* The first user to rejoin will have to do so via an alias on a different server.
495+
* The first user to rejoin will have to do so via an alias on a different
496+
server (or receive an invite from a user on a different server).
496497

497498
With all that being said, if you still want to try and recover the room:
498499

499-
1. For safety reasons, shut down Synapse.
500-
2. In the database, run `DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';`
501-
* For caution: it's recommended to run this in a transaction: `BEGIN; DELETE ...;`, verify you got 1 result, then `COMMIT;`.
502-
* The room ID is the same one supplied to the shutdown room API, not the Content Violation room.
503-
3. Restart Synapse.
500+
1. If the room was `block`ed, you must unblock it on your server. This can be
501+
accomplished as follows:
504502

505-
You will have to manually handle, if you so choose, the following:
503+
1. For safety reasons, shut down Synapse.
504+
2. In the database, run `DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';`
505+
* For caution: it's recommended to run this in a transaction: `BEGIN; DELETE ...;`, verify you got 1 result, then `COMMIT;`.
506+
* The room ID is the same one supplied to the delete room API, not the Content Violation room.
507+
3. Restart Synapse.
506508

507-
* Aliases that would have been redirected to the Content Violation room.
508-
* Users that would have been booted from the room (and will have been force-joined to the Content Violation room).
509-
* Removal of the Content Violation room if desired.
509+
This step is unnecessary if `block` was not set.
510+
511+
2. Any room aliases on your server that pointed to the deleted room may have
512+
been deleted, or redirected to the Content Violation room. These will need
513+
to be restored manually.
514+
515+
3. Users on your server that were in the deleted room will have been kicked
516+
from the room. Consider whether you want to update their membership
517+
(possibly via the [Edit Room Membership API](room_membership.md)) or let
518+
them handle rejoining themselves.
519+
520+
4. If `new_room_user_id` was given, a 'Content Violation' will have been
521+
created. Consider whether you want to delete that roomm.
510522

511523
## Deprecated endpoint
512524

@@ -536,7 +548,7 @@ POST /_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin
536548
# Forward Extremities Admin API
537549

538550
Enables querying and deleting forward extremities from rooms. When a lot of forward
539-
extremities accumulate in a room, performance can become degraded. For details, see
551+
extremities accumulate in a room, performance can become degraded. For details, see
540552
[#1760](https://github.com/matrix-org/synapse/issues/1760).
541553

542554
## Check for forward extremities
@@ -565,7 +577,7 @@ A response as follows will be returned:
565577

566578
## Deleting forward extremities
567579

568-
**WARNING**: Please ensure you know what you're doing and have read
580+
**WARNING**: Please ensure you know what you're doing and have read
569581
the related issue [#1760](https://github.com/matrix-org/synapse/issues/1760).
570582
Under no situations should this API be executed as an automated maintenance task!
571583

docs/development/url_previews.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
URL Previews
2+
============
3+
4+
The `GET /_matrix/media/r0/preview_url` endpoint provides a generic preview API
5+
for URLs which outputs [Open Graph](https://ogp.me/) responses (with some Matrix
6+
specific additions).
7+
8+
This does have trade-offs compared to other designs:
9+
10+
* Pros:
11+
* Simple and flexible; can be used by any clients at any point
12+
* Cons:
13+
* If each homeserver provides one of these independently, all the HSes in a
14+
room may needlessly DoS the target URI
15+
* The URL metadata must be stored somewhere, rather than just using Matrix
16+
itself to store the media.
17+
* Matrix cannot be used to distribute the metadata between homeservers.
18+
19+
When Synapse is asked to preview a URL it does the following:
20+
21+
1. Checks against a URL blacklist (defined as `url_preview_url_blacklist` in the
22+
config).
23+
2. Checks the in-memory cache by URLs and returns the result if it exists. (This
24+
is also used to de-duplicate processing of multiple in-flight requests at once.)
25+
3. Kicks off a background process to generate a preview:
26+
1. Checks the database cache by URL and timestamp and returns the result if it
27+
has not expired and was successful (a 2xx return code).
28+
2. Checks if the URL matches an oEmbed pattern. If it does, fetch the oEmbed
29+
response. If this is an image, replace the URL to fetch and continue. If
30+
if it is HTML content, use the HTML as the document and continue.
31+
3. If it doesn't match an oEmbed pattern, downloads the URL and stores it
32+
into a file via the media storage provider and saves the local media
33+
metadata.
34+
5. If the media is an image:
35+
1. Generates thumbnails.
36+
2. Generates an Open Graph response based on image properties.
37+
6. If the media is HTML:
38+
1. Decodes the HTML via the stored file.
39+
2. Generates an Open Graph response from the HTML.
40+
3. If an image exists in the Open Graph response:
41+
1. Downloads the URL and stores it into a file via the media storage
42+
provider and saves the local media metadata.
43+
2. Generates thumbnails.
44+
3. Updates the Open Graph response based on image properties.
45+
7. Stores the result in the database cache.
46+
4. Returns the result.
47+
48+
The in-memory cache expires after 1 hour.
49+
50+
Expired entries in the database cache (and their associated media files) are
51+
deleted every 10 seconds. The default expiration time is 1 hour from download.

docs/log_contexts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Logcontexts are also used for CPU and database accounting, so that we
1010
can track which requests were responsible for high CPU use or database
1111
activity.
1212

13-
The `synapse.logging.context` module provides a facilities for managing
13+
The `synapse.logging.context` module provides facilities for managing
1414
the current log context (as well as providing the `LoggingContextFilter`
1515
class).
1616

@@ -351,7 +351,7 @@ and the awaitable chain is now orphaned, and will be garbage-collected at
351351
some point. Note that `await_something_interesting` is a coroutine,
352352
which Python implements as a generator function. When Python
353353
garbage-collects generator functions, it gives them a chance to
354-
clean up by making the `async` (or `yield`) raise a `GeneratorExit`
354+
clean up by making the `await` (or `yield`) raise a `GeneratorExit`
355355
exception. In our case, that means that the `__exit__` handler of
356356
`PreserveLoggingContext` will carefully restore the request context, but
357357
there is now nothing waiting for its return, so the request context is

0 commit comments

Comments
 (0)