Skip to content

Commit 4bba1ea

Browse files
committed
Merge tag 'v1.122.0' into develop
Please note that this version of Synapse drops support for PostgreSQL 11 and 12. The minimum version of PostgreSQL supported is now version 13. No significant changes since 1.122.0rc1. - Remove support for PostgreSQL 11 and 12. Contributed by @clokep. ([\#18034](element-hq/synapse#18034)) - Added the `email.tlsname` config option. This allows specifying the domain name used to validate the SMTP server's TLS certificate separately from the `email.smtp_host` to connect to. ([\#17849](element-hq/synapse#17849)) - Module developers will have access to the user ID of the requester when adding `check_username_for_spam` callbacks to `spam_checker_module_callbacks`. Contributed by Wilson@Pangea.chat. ([\#17916](element-hq/synapse#17916)) - Add endpoints to the Admin API to fetch the number of invites the provided user has sent after a given timestamp, fetch the number of rooms the provided user has joined after a given timestamp, and get report IDs of event reports against a provided user (i.e. where the user was the sender of the reported event). ([\#17948](element-hq/synapse#17948)) - Support stable account suspension from [MSC3823](matrix-org/matrix-spec-proposals#3823). ([\#17964](element-hq/synapse#17964)) - Add `macaroon_secret_key_path` config option. ([\#17983](element-hq/synapse#17983)) - Fix bug when rejecting withdrew invite with a `third_party_rules` module, where the invite would be stuck for the client. ([\#17930](element-hq/synapse#17930)) - Properly purge state groups tables when purging a room with the Admin API. ([\#18024](element-hq/synapse#18024)) - Fix a bug preventing the admin redaction endpoint from working on messages from remote users. ([\#18029](element-hq/synapse#18029), [\#18043](element-hq/synapse#18043)) - Update `synapse.app.generic_worker` documentation to only recommend `GET` requests for stream writer routes by default, unless the worker is also configured as a stream writer. Contributed by @evoL. ([\#17954](element-hq/synapse#17954)) - Add documentation for the previously-undocumented `last_seen_ts` query parameter to the query user Admin API. ([\#17976](element-hq/synapse#17976)) - Improve documentation for the `TaskScheduler` class. ([\#17992](element-hq/synapse#17992)) - Fix example in reverse proxy docs to include server port. ([\#17994](element-hq/synapse#17994)) - Update Alpine Linux Synapse Package Maintainer within the installation instructions. ([\#17846](element-hq/synapse#17846)) - Add `RoomID` & `EventID` rust types. ([\#17996](element-hq/synapse#17996)) - Fix various type errors across the codebase. ([\#17998](element-hq/synapse#17998)) - Disable DB statement timeout when doing a room purge since it can be quite long. ([\#18017](element-hq/synapse#18017)) - Remove some remaining uses of `twisted.internet.defer.returnValue`. Contributed by Colin Watson. ([\#18020](element-hq/synapse#18020)) - Refactor `get_profile` to no longer include fields with a value of `None`. ([\#18063](element-hq/synapse#18063)) * Bump anyhow from 1.0.93 to 1.0.95. ([\#18012](element-hq/synapse#18012), [\#18045](element-hq/synapse#18045)) * Bump authlib from 1.3.2 to 1.4.0. ([\#18048](element-hq/synapse#18048)) * Bump dawidd6/action-download-artifact from 6 to 7. ([\#17981](element-hq/synapse#17981)) * Bump http from 1.1.0 to 1.2.0. ([\#18013](element-hq/synapse#18013)) - Bump mypy from 1.11.2 to 1.12.1. ([\#17999](element-hq/synapse#17999)) * Bump mypy-zope from 1.0.8 to 1.0.9. ([\#18047](element-hq/synapse#18047)) * Bump pillow from 10.4.0 to 11.0.0. ([\#18015](element-hq/synapse#18015)) * Bump pydantic from 2.9.2 to 2.10.3. ([\#18014](element-hq/synapse#18014)) * Bump pyicu from 2.13.1 to 2.14. ([\#18060](element-hq/synapse#18060)) * Bump pyo3 from 0.23.2 to 0.23.3. ([\#18001](element-hq/synapse#18001)) * Bump python-multipart from 0.0.16 to 0.0.18. ([\#17985](element-hq/synapse#17985)) * Bump sentry-sdk from 2.17.0 to 2.19.2. ([\#18061](element-hq/synapse#18061)) * Bump serde from 1.0.215 to 1.0.217. ([\#18031](element-hq/synapse#18031), [\#18059](element-hq/synapse#18059)) * Bump serde_json from 1.0.133 to 1.0.134. ([\#18044](element-hq/synapse#18044)) * Bump twine from 5.1.1 to 6.0.1. ([\#18049](element-hq/synapse#18049)) **Changelogs for older versions can be found [here](docs/changelogs/).**
2 parents 3ca171d + 5c736cd commit 4bba1ea

Some content is hidden

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

67 files changed

+5277
-4329
lines changed

.ci/scripts/calculate_jobs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_output(key: str, value: str):
6060
{
6161
"python-version": "3.9",
6262
"database": "postgres",
63-
"postgres-version": "11",
63+
"postgres-version": "13",
6464
"extras": "all",
6565
}
6666
]

.github/workflows/docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
id-token: write # needed for signing the images with GitHub OIDC Token
1515
jobs:
1616
build:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Set up Docker Buildx
2020
id: buildx

CHANGES.md

+40-3,759
Large diffs are not rendered by default.

Cargo.lock

+20-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/cmdclient/console.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _check_can_login(self):
245245

246246
if "flows" not in json_res:
247247
print("Failed to find any login flows.")
248-
defer.returnValue(False)
248+
return False
249249

250250
flow = json_res["flows"][0] # assume first is the one we want.
251251
if "type" not in flow or "m.login.password" != flow["type"] or "stages" in flow:
@@ -254,8 +254,8 @@ def _check_can_login(self):
254254
"Unable to login via the command line client. Please visit "
255255
"%s to login." % fallback_url
256256
)
257-
defer.returnValue(False)
258-
defer.returnValue(True)
257+
return False
258+
return True
259259

260260
def do_emailrequest(self, line):
261261
"""Requests the association of a third party identifier

contrib/cmdclient/http.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def put_json(self, url, data):
7878
url, data, headers_dict={"Content-Type": ["application/json"]}
7979
)
8080
body = yield readBody(response)
81-
defer.returnValue((response.code, body))
81+
return response.code, body
8282

8383
@defer.inlineCallbacks
8484
def get_json(self, url, args=None):
@@ -88,7 +88,7 @@ def get_json(self, url, args=None):
8888
url = "%s?%s" % (url, qs)
8989
response = yield self._create_get_request(url)
9090
body = yield readBody(response)
91-
defer.returnValue(json.loads(body))
91+
return json.loads(body)
9292

9393
def _create_put_request(self, url, json_data, headers_dict: Optional[dict] = None):
9494
"""Wrapper of _create_request to issue a PUT request"""
@@ -134,7 +134,7 @@ def do_request(
134134
response = yield self._create_request(method, url)
135135

136136
body = yield readBody(response)
137-
defer.returnValue(json.loads(body))
137+
return json.loads(body)
138138

139139
@defer.inlineCallbacks
140140
def _create_request(
@@ -173,7 +173,7 @@ def _create_request(
173173
if self.verbose:
174174
print("Status %s %s" % (response.code, response.phrase))
175175
print(pformat(list(response.headers.getAllRawHeaders())))
176-
defer.returnValue(response)
176+
return response
177177

178178
def sleep(self, seconds):
179179
d = defer.Deferred()

debian/changelog

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
matrix-synapse-py3 (1.122.0) stable; urgency=medium
2+
3+
* New Synapse release 1.122.0.
4+
5+
-- Synapse Packaging team <packages@matrix.org> Tue, 14 Jan 2025 14:14:14 +0000
6+
7+
matrix-synapse-py3 (1.122.0~rc1) stable; urgency=medium
8+
9+
* New Synapse release 1.122.0rc1.
10+
11+
-- Synapse Packaging team <packages@matrix.org> Tue, 07 Jan 2025 14:06:19 +0000
12+
13+
matrix-synapse-py3 (1.121.1) stable; urgency=medium
14+
15+
* New Synapse release 1.121.1.
16+
17+
-- Synapse Packaging team <packages@matrix.org> Wed, 11 Dec 2024 18:24:48 +0000
18+
119
matrix-synapse-py3 (1.121.0) stable; urgency=medium
220

321
* New Synapse release 1.121.0.

docker/conf-workers/nginx.conf.j2

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ server {
3838
{% if using_unix_sockets %}
3939
proxy_pass http://unix:/run/main_public.sock;
4040
{% else %}
41+
# note: do not add a path (even a single /) after the port in `proxy_pass`,
42+
# otherwise nginx will canonicalise the URI and cause signature verification
43+
# errors.
4144
proxy_pass http://localhost:8080;
4245
{% endif %}
4346
proxy_set_header X-Forwarded-For $remote_addr;

docs/admin_api/event_reports.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ paginate through.
6060
anything other than the return value of `next_token` from a previous call. Defaults to `0`.
6161
* `dir`: string - Direction of event report order. Whether to fetch the most recent
6262
first (`b`) or the oldest first (`f`). Defaults to `b`.
63-
* `user_id`: string - Is optional and filters to only return users with user IDs that
64-
contain this value. This is the user who reported the event and wrote the reason.
65-
* `room_id`: string - Is optional and filters to only return rooms with room IDs that
66-
contain this value.
63+
* `user_id`: optional string - Filter by the user ID of the reporter. This is the user who reported the event
64+
and wrote the reason.
65+
* `room_id`: optional string - Filter by room id.
66+
* `event_sender_user_id`: optional string - Filter by the sender of the reported event. This is the user who
67+
the report was made against.
6768

6869
**Response**
6970

docs/admin_api/user_admin_api.md

+73-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ It returns a JSON body like the following:
4040
"erased": false,
4141
"shadow_banned": 0,
4242
"creation_ts": 1560432506,
43+
"last_seen_ts": 1732919539393,
4344
"appservice_id": null,
4445
"consent_server_notice_sent": null,
4546
"consent_version": null,
@@ -477,9 +478,9 @@ with a body of:
477478
}
478479
```
479480

480-
## List room memberships of a user
481+
## List joined rooms of a user
481482

482-
Gets a list of all `room_id` that a specific `user_id` is member.
483+
Gets a list of all `room_id` that a specific `user_id` is joined to and is a member of (participating in).
483484

484485
The API is:
485486

@@ -516,6 +517,73 @@ The following fields are returned in the JSON response body:
516517
- `joined_rooms` - An array of `room_id`.
517518
- `total` - Number of rooms.
518519

520+
## Get the number of invites sent by the user
521+
522+
Fetches the number of invites sent by the provided user ID across all rooms
523+
after the given timestamp.
524+
525+
```
526+
GET /_synapse/admin/v1/users/$user_id/sent_invite_count
527+
```
528+
529+
**Parameters**
530+
531+
The following parameters should be set in the URL:
532+
533+
* `user_id`: fully qualified: for example, `@user:server.com`
534+
535+
The following should be set as query parameters in the URL:
536+
537+
* `from_ts`: int, required. A timestamp in ms from the unix epoch. Only
538+
invites sent at or after the provided timestamp will be returned.
539+
This works by comparing the provided timestamp to the `received_ts`
540+
column in the `events` table.
541+
Note: https://currentmillis.com/ is a useful tool for converting dates
542+
into timestamps and vice versa.
543+
544+
A response body like the following is returned:
545+
546+
```json
547+
{
548+
"invite_count": 30
549+
}
550+
```
551+
552+
_Added in Synapse 1.122.0_
553+
554+
## Get the cumulative number of rooms a user has joined after a given timestamp
555+
556+
Fetches the number of rooms that the user joined after the given timestamp, even
557+
if they have subsequently left/been banned from those rooms.
558+
559+
```
560+
GET /_synapse/admin/v1/users/$<user_id/cumulative_joined_room_count
561+
```
562+
563+
**Parameters**
564+
565+
The following parameters should be set in the URL:
566+
567+
* `user_id`: fully qualified: for example, `@user:server.com`
568+
569+
The following should be set as query parameters in the URL:
570+
571+
* `from_ts`: int, required. A timestamp in ms from the unix epoch. Only
572+
invites sent at or after the provided timestamp will be returned.
573+
This works by comparing the provided timestamp to the `received_ts`
574+
column in the `events` table.
575+
Note: https://currentmillis.com/ is a useful tool for converting dates
576+
into timestamps and vice versa.
577+
578+
A response body like the following is returned:
579+
580+
```json
581+
{
582+
"cumulative_joined_room_count": 30
583+
}
584+
```
585+
_Added in Synapse 1.122.0_
586+
519587
## Account Data
520588
Gets information about account data for a specific `user_id`.
521589

@@ -1444,4 +1512,6 @@ The following fields are returned in the JSON response body:
14441512
- `failed_redactions` - dictionary - the keys of the dict are event ids the process was unable to redact, if any, and the values are
14451513
the corresponding error that caused the redaction to fail
14461514

1447-
_Added in Synapse 1.116.0._
1515+
_Added in Synapse 1.116.0._
1516+
1517+

0 commit comments

Comments
 (0)