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

Commit b500fcb

Browse files
author
David Robertson
committed
Merge tag 'v1.51.0'
Synapse 1.51.0 (2022-01-25) =========================== No significant changes since 1.51.0rc2. Synapse 1.51.0 deprecates `webclient` listeners and non-HTTP(S) `web_client_location`s. Support for these will be removed in Synapse 1.53.0, at which point Synapse will not be capable of directly serving a web client for Matrix. Synapse 1.51.0rc2 (2022-01-24) ============================== Bugfixes -------- - Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](#11806)) Synapse 1.51.0rc1 (2022-01-21) ============================== Features -------- - Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts. ([\#11561](#11561), [\#11749](#11749), [\#11757](#11757)) - Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](matrix-org/matrix-spec-proposals#3440). ([\#11577](#11577)) - Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room. ([\#11672](#11672)) - Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. ([\#11675](#11675), [\#11770](#11770)) Bugfixes -------- - Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events received over federation. ([\#11530](#11530)) - Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices. ([\#11587](#11587)) - Fix an error that occurs whilst trying to get the federation status of a destination server that was working normally. This admin API was newly introduced in Synapse v1.49.0. ([\#11593](#11593)) - Fix bundled aggregations not being included in the `/sync` response, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\#11612](#11612), [\#11659](#11659), [\#11791](#11791)) - Fix the `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0. ([\#11667](#11667)) - Fix preview of some GIF URLs (like tenor.com). Contributed by Philippe Daouadi. ([\#11669](#11669)) - Fix a bug where only the first 50 rooms from a space were returned from the `/hierarchy` API. This has existed since the introduction of the API in Synapse v1.41.0. ([\#11695](#11695)) - Fix a bug introduced in Synapse v1.18.0 where password reset and address validation emails would not be sent if their subject was configured to use the 'app' template variable. Contributed by @br4nnigan. ([\#11710](#11710), [\#11745](#11745)) - Make the 'List Rooms' Admin API sort stable. Contributed by Daniël Sonck. ([\#11737](#11737)) - Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time. ([\#11775](#11775)) - Fix a bug introduced in Synapse v1.46.0 that prevented `on_logged_out` module callbacks from being correctly awaited by Synapse. ([\#11786](#11786)) Improved Documentation ---------------------- - Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This works around client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr. ([\#11686](#11686)) - Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide. ([\#11715](#11715)) - Document that the minimum supported PostgreSQL version is now 10. ([\#11725](#11725)) - Fix typo in demo docs: differnt. ([\#11735](#11735)) - Update room spec URL in config files. ([\#11739](#11739)) - Mention `python3-venv` and `libpq-dev` dependencies in the contribution guide. ([\#11740](#11740)) - Update documentation for configuring login with Facebook. ([\#11755](#11755)) - Update installation instructions to note that Python 3.6 is no longer supported. ([\#11781](#11781)) Deprecations and Removals ------------------------- - Remove the unstable `/send_relation` endpoint. ([\#11682](#11682)) - Remove `python_twisted_reactor_pending_calls` Prometheus metric. ([\#11724](#11724)) - Remove the `password_hash` field from the response dictionaries of the [Users Admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html). ([\#11576](#11576)) - **Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration. ([\#11774](#11774), [\#11783](#11783 Internal Changes ---------------- - Run `pyupgrade --py37-plus --keep-percent-format` on Synapse. ([\#11685](#11685)) - Use buildkit's cache feature to speed up docker builds. ([\#11691](#11691)) - Use `auto_attribs` and native type hints for attrs classes. ([\#11692](#11692), [\#11768](#11768)) - Remove debug logging for #4422, which has been closed since Synapse 0.99. ([\#11693](#11693)) - Remove fallback code for Python 2. ([\#11699](#11699)) - Add a test for [an edge case](#11532 (comment)) in the `/sync` logic. ([\#11701](#11701)) - Add the option to write SQLite test dbs to disk when running tests. ([\#11702](#11702)) - Improve Complement test output for Gitub Actions. ([\#11707](#11707)) - Fix docstring on `add_account_data_for_user`. ([\#11716](#11716)) - Complement environment variable name change and update `.gitignore`. ([\#11718](#11718)) - Simplify calculation of Prometheus metrics for garbage collection. ([\#11723](#11723)) - Improve accuracy of `python_twisted_reactor_tick_time` Prometheus metric. ([\#11724](#11724), [\#11771](#11771)) - Minor efficiency improvements when inserting many values into the database. ([\#11742](#11742)) - Invite PR authors to give themselves credit in the changelog. ([\#11744](#11744)) - Add optional debugging to investigate [issue 8631](#8631). ([\#11760](#11760)) - Remove `log_function` utility function and its uses. ([\#11761](#11761)) - Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled. ([\#11765](#11765)) - Allow overriding complement commit using `COMPLEMENT_REF`. ([\#11766](#11766)) - Add some comments and type annotations for `_update_outliers_txn`. ([\#11776](#11776))
2 parents 36f37ac + 343d4f1 commit b500fcb

File tree

135 files changed

+2592
-1646
lines changed

Some content is hidden

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

135 files changed

+2592
-1646
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Use markdown where necessary, mostly for `code blocks`.
99
- End with either a period (.) or an exclamation mark (!).
1010
- Start with a capital letter.
11+
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
1112
* [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
1213
* [ ] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
1314
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

.github/workflows/tests.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ jobs:
366366
# Build initial Synapse image
367367
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
368368
working-directory: synapse
369+
env:
370+
DOCKER_BUILDKIT: 1
369371

370372
# Build a ready-to-run Synapse image based on the initial image above.
371373
# This new image includes a config file, keys for signing and TLS, and
@@ -374,7 +376,8 @@ jobs:
374376
working-directory: complement/dockerfiles
375377

376378
# Run Complement
377-
- run: go test -v -tags synapse_blacklist,msc2403 ./tests/...
379+
- run: set -o pipefail && go test -v -json -tags synapse_blacklist,msc2403 ./tests/... 2>&1 | gotestfmt
380+
shell: bash
378381
env:
379382
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
380383
working-directory: complement

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ __pycache__/
5050

5151
# docs
5252
book/
53+
54+
# complement
55+
/complement-*
56+
/master.tar.gz

CHANGES.md

+92-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,103 @@
1-
Synapse 1.50.2 (2022-01-24)
1+
Synapse 1.51.0 (2022-01-25)
22
===========================
33

4+
No significant changes since 1.51.0rc2.
5+
6+
Synapse 1.51.0 deprecates `webclient` listeners and non-HTTP(S) `web_client_location`s. Support for these will be removed in Synapse 1.53.0, at which point Synapse will not be capable of directly serving a web client for Matrix.
7+
8+
Synapse 1.51.0rc2 (2022-01-24)
9+
==============================
10+
411
Bugfixes
512
--------
613

714
- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
815

916

17+
Synapse 1.51.0rc1 (2022-01-21)
18+
==============================
19+
20+
Features
21+
--------
22+
23+
- Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts. ([\#11561](https://github.com/matrix-org/synapse/issues/11561), [\#11749](https://github.com/matrix-org/synapse/issues/11749), [\#11757](https://github.com/matrix-org/synapse/issues/11757))
24+
- Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440). ([\#11577](https://github.com/matrix-org/synapse/issues/11577))
25+
- Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room. ([\#11672](https://github.com/matrix-org/synapse/issues/11672))
26+
- Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. ([\#11675](https://github.com/matrix-org/synapse/issues/11675), [\#11770](https://github.com/matrix-org/synapse/issues/11770))
27+
28+
29+
Bugfixes
30+
--------
31+
32+
- Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
33+
received over federation. ([\#11530](https://github.com/matrix-org/synapse/issues/11530))
34+
- Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices. ([\#11587](https://github.com/matrix-org/synapse/issues/11587))
35+
- Fix an error that occurs whilst trying to get the federation status of a destination server that was working normally. This admin API was newly introduced in Synapse v1.49.0. ([\#11593](https://github.com/matrix-org/synapse/issues/11593))
36+
- Fix bundled aggregations not being included in the `/sync` response, per [MSC2675](https://github.com/matrix-org/matrix-doc/pull/2675). ([\#11612](https://github.com/matrix-org/synapse/issues/11612), [\#11659](https://github.com/matrix-org/synapse/issues/11659), [\#11791](https://github.com/matrix-org/synapse/issues/11791))
37+
- Fix the `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0. ([\#11667](https://github.com/matrix-org/synapse/issues/11667))
38+
- Fix preview of some GIF URLs (like tenor.com). Contributed by Philippe Daouadi. ([\#11669](https://github.com/matrix-org/synapse/issues/11669))
39+
- Fix a bug where only the first 50 rooms from a space were returned from the `/hierarchy` API. This has existed since the introduction of the API in Synapse v1.41.0. ([\#11695](https://github.com/matrix-org/synapse/issues/11695))
40+
- Fix a bug introduced in Synapse v1.18.0 where password reset and address validation emails would not be sent if their subject was configured to use the 'app' template variable. Contributed by @br4nnigan. ([\#11710](https://github.com/matrix-org/synapse/issues/11710), [\#11745](https://github.com/matrix-org/synapse/issues/11745))
41+
- Make the 'List Rooms' Admin API sort stable. Contributed by Daniël Sonck. ([\#11737](https://github.com/matrix-org/synapse/issues/11737))
42+
- Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time. ([\#11775](https://github.com/matrix-org/synapse/issues/11775))
43+
- Fix a bug introduced in Synapse v1.46.0 that prevented `on_logged_out` module callbacks from being correctly awaited by Synapse. ([\#11786](https://github.com/matrix-org/synapse/issues/11786))
44+
45+
46+
Improved Documentation
47+
----------------------
48+
49+
- Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This works around client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr. ([\#11686](https://github.com/matrix-org/synapse/issues/11686))
50+
- Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide. ([\#11715](https://github.com/matrix-org/synapse/issues/11715))
51+
- Document that the minimum supported PostgreSQL version is now 10. ([\#11725](https://github.com/matrix-org/synapse/issues/11725))
52+
- Fix typo in demo docs: differnt. ([\#11735](https://github.com/matrix-org/synapse/issues/11735))
53+
- Update room spec URL in config files. ([\#11739](https://github.com/matrix-org/synapse/issues/11739))
54+
- Mention `python3-venv` and `libpq-dev` dependencies in the contribution guide. ([\#11740](https://github.com/matrix-org/synapse/issues/11740))
55+
- Update documentation for configuring login with Facebook. ([\#11755](https://github.com/matrix-org/synapse/issues/11755))
56+
- Update installation instructions to note that Python 3.6 is no longer supported. ([\#11781](https://github.com/matrix-org/synapse/issues/11781))
57+
58+
59+
Deprecations and Removals
60+
-------------------------
61+
62+
- Remove the unstable `/send_relation` endpoint. ([\#11682](https://github.com/matrix-org/synapse/issues/11682))
63+
- Remove `python_twisted_reactor_pending_calls` Prometheus metric. ([\#11724](https://github.com/matrix-org/synapse/issues/11724))
64+
- Remove the `password_hash` field from the response dictionaries of the [Users Admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html). ([\#11576](https://github.com/matrix-org/synapse/issues/11576))
65+
- **Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration. ([\#11774](https://github.com/matrix-org/synapse/issues/11774), [\#11783](https://github.com/matrix-org/synapse/issues/11783))**
66+
67+
68+
Internal Changes
69+
----------------
70+
71+
- Run `pyupgrade --py37-plus --keep-percent-format` on Synapse. ([\#11685](https://github.com/matrix-org/synapse/issues/11685))
72+
- Use buildkit's cache feature to speed up docker builds. ([\#11691](https://github.com/matrix-org/synapse/issues/11691))
73+
- Use `auto_attribs` and native type hints for attrs classes. ([\#11692](https://github.com/matrix-org/synapse/issues/11692), [\#11768](https://github.com/matrix-org/synapse/issues/11768))
74+
- Remove debug logging for #4422, which has been closed since Synapse 0.99. ([\#11693](https://github.com/matrix-org/synapse/issues/11693))
75+
- Remove fallback code for Python 2. ([\#11699](https://github.com/matrix-org/synapse/issues/11699))
76+
- Add a test for [an edge case](https://github.com/matrix-org/synapse/pull/11532#discussion_r769104461) in the `/sync` logic. ([\#11701](https://github.com/matrix-org/synapse/issues/11701))
77+
- Add the option to write SQLite test dbs to disk when running tests. ([\#11702](https://github.com/matrix-org/synapse/issues/11702))
78+
- Improve Complement test output for Gitub Actions. ([\#11707](https://github.com/matrix-org/synapse/issues/11707))
79+
- Fix docstring on `add_account_data_for_user`. ([\#11716](https://github.com/matrix-org/synapse/issues/11716))
80+
- Complement environment variable name change and update `.gitignore`. ([\#11718](https://github.com/matrix-org/synapse/issues/11718))
81+
- Simplify calculation of Prometheus metrics for garbage collection. ([\#11723](https://github.com/matrix-org/synapse/issues/11723))
82+
- Improve accuracy of `python_twisted_reactor_tick_time` Prometheus metric. ([\#11724](https://github.com/matrix-org/synapse/issues/11724), [\#11771](https://github.com/matrix-org/synapse/issues/11771))
83+
- Minor efficiency improvements when inserting many values into the database. ([\#11742](https://github.com/matrix-org/synapse/issues/11742))
84+
- Invite PR authors to give themselves credit in the changelog. ([\#11744](https://github.com/matrix-org/synapse/issues/11744))
85+
- Add optional debugging to investigate [issue 8631](https://github.com/matrix-org/synapse/issues/8631). ([\#11760](https://github.com/matrix-org/synapse/issues/11760))
86+
- Remove `log_function` utility function and its uses. ([\#11761](https://github.com/matrix-org/synapse/issues/11761))
87+
- Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled. ([\#11765](https://github.com/matrix-org/synapse/issues/11765))
88+
- Allow overriding complement commit using `COMPLEMENT_REF`. ([\#11766](https://github.com/matrix-org/synapse/issues/11766))
89+
- Add some comments and type annotations for `_update_outliers_txn`. ([\#11776](https://github.com/matrix-org/synapse/issues/11776))
90+
91+
92+
Synapse 1.50.2 (2022-01-24)
93+
===========================
94+
95+
Bugfixes
96+
--------
97+
98+
- Backport the sole fix from v1.51.0rc2. This fixes a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
99+
100+
10101
Synapse 1.50.1 (2022-01-18)
11102
===========================
12103

contrib/prometheus/consoles/synapse.html

-16
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,6 @@ <h3>Average reactor tick time</h3>
9292
})
9393
</script>
9494

95-
<h3>Pending calls per tick</h3>
96-
<div id="reactor_pending_calls"></div>
97-
<script>
98-
new PromConsole.Graph({
99-
node: document.querySelector("#reactor_pending_calls"),
100-
expr: "rate(python_twisted_reactor_pending_calls_sum[30s]) / rate(python_twisted_reactor_pending_calls_count[30s])",
101-
name: "[[job]]-[[index]]",
102-
min: 0,
103-
renderer: "line",
104-
height: 150,
105-
yAxisFormatter: PromConsole.NumberFormatter.humanize,
106-
yHoverFormatter: PromConsole.NumberFormatter.humanize,
107-
yTitle: "Pending Calls"
108-
})
109-
</script>
110-
11195
<h1>Storage</h1>
11296

11397
<h3>Queries</h3>

debian/changelog

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
matrix-synapse-py3 (1.51.0) stable; urgency=medium
2+
3+
* New synapse release 1.51.0.
4+
5+
-- Synapse Packaging team <[email protected]> Tue, 25 Jan 2022 11:28:51 +0000
6+
7+
matrix-synapse-py3 (1.51.0~rc2) stable; urgency=medium
8+
9+
* New synapse release 1.51.0~rc2.
10+
11+
-- Synapse Packaging team <[email protected]> Mon, 24 Jan 2022 12:25:00 +0000
12+
13+
matrix-synapse-py3 (1.51.0~rc1) stable; urgency=medium
14+
15+
* New synapse release 1.51.0~rc1.
16+
17+
-- Synapse Packaging team <[email protected]> Fri, 21 Jan 2022 10:46:02 +0000
18+
119
matrix-synapse-py3 (1.50.2) stable; urgency=medium
220

321
* New synapse release 1.50.2.

demo/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Logs and sqlitedb will be stored in demo/808{0,1,2}.{log,db}
2222

2323

2424

25-
Also note that when joining a public room on a differnt HS via "#foo:bar.net", then you are (in the current impl) joining a room with room_id "foo". This means that it won't work if your HS already has a room with that name.
25+
Also note that when joining a public room on a different HS via "#foo:bar.net", then you are (in the current impl) joining a room with room_id "foo". This means that it won't work if your HS already has a room with that name.
2626

docker/Dockerfile

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Dockerfile to build the matrixdotorg/synapse docker images.
22
#
3+
# Note that it uses features which are only available in BuildKit - see
4+
# https://docs.docker.com/go/buildkit/ for more information.
5+
#
36
# To build the image, run `docker build` command from the root of the
47
# synapse repository:
58
#
6-
# docker build -f docker/Dockerfile .
9+
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile .
710
#
811
# There is an optional PYTHON_VERSION build argument which sets the
912
# version of python to build against: for example:
1013
#
11-
# docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 .
14+
# DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.9 .
1215
#
1316

1417
ARG PYTHON_VERSION=3.8
@@ -19,7 +22,16 @@ ARG PYTHON_VERSION=3.8
1922
FROM docker.io/python:${PYTHON_VERSION}-slim as builder
2023

2124
# install the OS build deps
22-
RUN apt-get update && apt-get install -y \
25+
#
26+
# RUN --mount is specific to buildkit and is documented at
27+
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount.
28+
# Here we use it to set up a cache for apt, to improve rebuild speeds on
29+
# slow connections.
30+
#
31+
RUN \
32+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
33+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
34+
apt-get update && apt-get install -y \
2335
build-essential \
2436
libffi-dev \
2537
libjpeg-dev \
@@ -44,7 +56,8 @@ COPY synapse/python_dependencies.py /synapse/synapse/python_dependencies.py
4456
# used while you develop on the source
4557
#
4658
# This is aiming at installing the `install_requires` and `extras_require` from `setup.py`
47-
RUN pip install --prefix="/install" --no-warn-script-location \
59+
RUN --mount=type=cache,target=/root/.cache/pip \
60+
pip install --prefix="/install" --no-warn-script-location \
4861
/synapse[all]
4962

5063
# Copy over the rest of the project
@@ -66,7 +79,10 @@ LABEL org.opencontainers.image.documentation='https://github.com/matrix-org/syna
6679
LABEL org.opencontainers.image.source='https://github.com/matrix-org/synapse.git'
6780
LABEL org.opencontainers.image.licenses='Apache-2.0'
6881

69-
RUN apt-get update && apt-get install -y \
82+
RUN \
83+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
84+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
85+
apt-get update && apt-get install -y \
7086
curl \
7187
gosu \
7288
libjpeg62-turbo \

docs/admin_api/user_admin_api.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ server admin: [Admin API](../usage/administration/admin_api)
1515

1616
It returns a JSON body like the following:
1717

18-
```json
18+
```jsonc
1919
{
20-
"displayname": "User",
20+
"name": "@user:example.com",
21+
"displayname": "User", // can be null if not set
2122
"threepids": [
2223
{
2324
"medium": "email",
@@ -32,11 +33,11 @@ It returns a JSON body like the following:
3233
"validated_at": 1586458409743
3334
}
3435
],
35-
"avatar_url": "<avatar_url>",
36+
"avatar_url": "<avatar_url>", // can be null if not set
37+
"is_guest": 0,
3638
"admin": 0,
3739
"deactivated": 0,
3840
"shadow_banned": 0,
39-
"password_hash": "$2b$12$p9B4GkqYdRTPGD",
4041
"creation_ts": 1560432506,
4142
"appservice_id": null,
4243
"consent_server_notice_sent": null,

docs/development/contributing_guide.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ recommended for development. More information about WSL can be found at
2020
<https://docs.microsoft.com/en-us/windows/wsl/install>. Running Synapse natively
2121
on Windows is not officially supported.
2222

23-
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://wiki.python.org/moin/BeginnersGuide/Download).
23+
The code of Synapse is written in Python 3. To do pretty much anything, you'll need [a recent version of Python 3](https://www.python.org/downloads/). Your Python also needs support for [virtual environments](https://docs.python.org/3/library/venv.html). This is usually built-in, but some Linux distributions like Debian and Ubuntu split it out into its own package. Running `sudo apt install python3-venv` should be enough.
24+
25+
Synapse can connect to PostgreSQL via the [psycopg2](https://pypi.org/project/psycopg2/) Python library. Building this library from source requires access to PostgreSQL's C header files. On Debian or Ubuntu Linux, these can be installed with `sudo apt install libpq-dev`.
2426

2527
The source code of Synapse is hosted on GitHub. You will also need [a recent version of git](https://github.com/git-guides/install-git).
2628

@@ -169,6 +171,27 @@ To increase the log level for the tests, set `SYNAPSE_TEST_LOG_LEVEL`:
169171
SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
170172
```
171173

174+
By default, tests will use an in-memory SQLite database for test data. For additional
175+
help with debugging, one can use an on-disk SQLite database file instead, in order to
176+
review database state during and after running tests. This can be done by setting
177+
the `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable. Doing so will cause the
178+
database state to be stored in a file named `test.db` under the trial process'
179+
working directory. Typically, this ends up being `_trial_temp/test.db`. For example:
180+
181+
```sh
182+
SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
183+
```
184+
185+
The database file can then be inspected with:
186+
187+
```sh
188+
sqlite3 _trial_temp/test.db
189+
```
190+
191+
Note that the database file is cleared at the beginning of each test run. Thus it
192+
will always only contain the data generated by the *last run test*. Though generally
193+
when debugging, one is only running a single test anyway.
194+
172195
### Running tests under PostgreSQL
173196

174197
Invoking `trial` as above will use an in-memory SQLite database. This is great for

docs/development/url_previews.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ When Synapse is asked to preview a URL it does the following:
3535
5. If the media is HTML:
3636
1. Decodes the HTML via the stored file.
3737
2. Generates an Open Graph response from the HTML.
38-
3. If an image exists in the Open Graph response:
38+
3. If a JSON oEmbed URL was found in the HTML via autodiscovery:
39+
1. Downloads the URL and stores it into a file via the media storage provider
40+
and saves the local media metadata.
41+
2. Convert the oEmbed response to an Open Graph response.
42+
3. Override any Open Graph data from the HTML with data from oEmbed.
43+
4. If an image exists in the Open Graph response:
3944
1. Downloads the URL and stores it into a file via the media storage
4045
provider and saves the local media metadata.
4146
2. Generates thumbnails.

0 commit comments

Comments
 (0)