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

Commit 9994998

Browse files
committed
Merge tag 'v1.45.0' into rav/sw1v-hotfixes
Synapse 1.45.0 (2021-10-19) =========================== No functional changes since Synapse 1.45.0rc2. Known Issues ------------ - A suspected [performance regression](#11049) which was first reported after the release of 1.44.0 remains unresolved. We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression. Improved Documentation ---------------------- - Reword changelog to clarify concerns about a suspected performance regression in 1.44.0. ([\#11117](#11117)) Synapse 1.45.0rc2 (2021-10-14) ============================== This release candidate [fixes](#11053) a user directory [bug](#11025) present in 1.45.0rc1. Known Issues ------------ - A suspected [performance regression](#11049) which was first reported after the release of 1.44.0 remains unresolved. We have not been able to identify a probable cause. Affected users report that setting up a federation sender worker appears to alleviate symptoms of the regression. Bugfixes -------- - Fix a long-standing bug when using multiple event persister workers where events were not correctly sent down `/sync` due to a race. ([\#11045](#11045)) - Fix a bug introduced in Synapse 1.45.0rc1 where the user directory would stop updating if it processed an event from a user not in the `users` table. ([\#11053](#11053)) - Fix a bug introduced in Synapse 1.44.0 when logging errors during oEmbed processing. ([\#11061](#11061)) Internal Changes ---------------- - Add an 'approximate difference' method to `StateFilter`. ([\#10825](#10825)) - Fix inconsistent behavior of `get_last_client_by_ip` when reporting data that has not been stored in the database yet. ([\#10970](#10970)) - Fix a bug introduced in Synapse 1.21.0 that causes opentracing and Prometheus metrics for replication requests to be measured incorrectly. ([\#10996](#10996)) - Ensure that cache config tests do not share state. ([\#11036](#11036)) Synapse 1.45.0rc1 (2021-10-12) ============================== **Note:** Media storage providers module that read from Synapse's configuration need changes as of this version, see the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1450) for more information. Known Issues ------------ - We are investigating [a performance issue](#11049) which was reported after the release of 1.44.0. - We are aware of [a bug](#11025) with the user directory when using application services. A second release candidate is expected which will resolve this. Features -------- - Add [MSC3069](matrix-org/matrix-spec-proposals#3069) support to `/account/whoami`. ([\#9655](#9655)) - Support autodiscovery of oEmbed previews. ([\#10822](#10822)) - Add a `user_may_send_3pid_invite` spam checker callback for modules to allow or deny 3PID invites. ([\#10894](#10894)) - Add a spam checker callback to allow or deny room joins. ([\#10910](#10910)) - Include an `update_synapse_database` script in the distribution. Contributed by @Fizzadar at Beeper. ([\#10954](#10954)) - Include exception information in JSON logging output. Contributed by @Fizzadar at Beeper. ([\#11028](#11028)) Bugfixes -------- - Fix a minor bug in the response to `/_matrix/client/r0/voip/turnServer`. Contributed by @lukaslihotzki. ([\#10922](#10922)) - Fix a bug where empty `yyyy-mm-dd/` directories would be left behind in the media store's `url_cache_thumbnails/` directory. ([\#10924](#10924)) - Fix a bug introduced in Synapse v1.40.0 where the signature checks for room version 8 and 9 could be applied to earlier room versions in some situations. ([\#10927](#10927)) - Fix a long-standing bug wherein deactivated users still count towards the monthly active users limit. ([\#10947](#10947)) - Fix a long-standing bug which meant that events received over federation were sometimes incorrectly accepted into the room state. ([\#10956](#10956)) - Fix a long-standing bug where rebuilding the user directory wouldn't exclude support and deactivated users. ([\#10960](#10960)) - Fix [MSC2716](matrix-org/matrix-spec-proposals#2716) `/batch_send` endpoint rejecting subsequent batches with unknown batch ID error in existing room versions from the room creator. ([\#10962](#10962)) - Fix a bug that could leak local users' per-room nicknames and avatars when the user directory is rebuilt. ([\#10981](#10981)) - Fix a long-standing bug where the remainder of a batch of user directory changes would be silently dropped if the server left a room early in the batch. ([\#10982](#10982)) - Correct a bugfix introduced in Synapse v1.44.0 that would catch the wrong error if a connection is lost before a response could be written to it. ([\#10995](#10995)) - Fix a long-standing bug where local users' per-room nicknames/avatars were visible to anyone who could see you in the user directory. ([\#11002](#11002)) - Fix a long-standing bug where a user's per-room nickname/avatar would overwrite their profile in the user directory when a room was made public. ([\#11003](#11003)) - Work around a regression, introduced in Synapse v1.39.0, that caused `SynapseError`s raised by the experimental third-party rules module callback `check_event_allowed` to be ignored. ([\#11042](#11042)) - Fix a bug in [MSC2716](matrix-org/matrix-spec-proposals#2716) insertion events in rooms that could cause cross-talk/conflicts between batches. ([\#10877](#10877)) Improved Documentation ---------------------- - Change wording ("reference homeserver") in Synapse repository documentation. Contributed by @maxkratz. ([\#10971](#10971)) - Fix a dead URL in development documentation (SAML) and change wording from "Riot" to "Element". Contributed by @maxkratz. ([\#10973](#10973)) - Add additional content to the Welcome and Overview page of the documentation. ([\#10990](#10990)) - Update links to MSCs in documentation. Contributed by @dklimpel. ([\#10991](#10991)) Internal Changes ---------------- - Improve type hinting in `synapse.util`. ([\#10888](#10888)) - Add further type hints to `synapse.storage.util`. ([\#10892](#10892)) - Fix type hints to be compatible with an upcoming change to Twisted. ([\#10895](#10895)) - Update utility code to handle C implementations of frozendict. ([\#10902](#10902)) - Drop old functionality which maintained database compatibility with Synapse versions before v1.31. ([\#10903](#10903)) - Clean-up configuration helper classes for the `ServerConfig` class. ([\#10915](#10915)) - Use direct references to config flags. ([\#10916](#10916), [\#10959](#10959), [\#10985](#10985)) - Clean up some of the federation event authentication code for clarity. ([\#10926](#10926), [\#10940](#10940), [\#10986](#10986), [\#10987](#10987), [\#10988](#10988), [\#11010](#11010), [\#11011](#11011)) - Refactor various parts of the codebase to use `RoomVersion` objects instead of room version identifier strings. ([\#10934](#10934)) - Refactor user directory tests in preparation for upcoming changes. ([\#10935](#10935)) - Include the event id in the logcontext when handling PDUs received over federation. ([\#10936](#10936)) - Fix logged errors in unit tests. ([\#10939](#10939)) - Fix a broken test to ensure that consent configuration works during registration. ([\#10945](#10945)) - Add type hints to filtering classes. ([\#10958](#10958)) - Add type-hint to `HomeserverTestcase.setup_test_homeserver`. ([\#10961](#10961)) - Fix the test utility function `create_room_as` so that `is_public=True` will explicitly set the `visibility` parameter of room creation requests to `public`. Contributed by @AndrewFerr. ([\#10963](#10963)) - Make the release script more robust and transparent. ([\#10966](#10966)) - Refactor [MSC2716](matrix-org/matrix-spec-proposals#2716) `/batch_send` mega function into smaller handler functions. ([\#10974](#10974)) - Log stack traces when a missing opentracing span is detected. ([\#10983](#10983)) - Update GHA config to run tests against Python 3.10 and PostgreSQL 14. ([\#10992](#10992)) - Fix a long-standing bug where `ReadWriteLock`s could drop logging contexts on exit. ([\#10993](#10993)) - Add a `CODEOWNERS` file to automatically request reviews from the `@matrix-org/synapse-core` team on new pull requests. ([\#10994](#10994)) - Add further type hints to `synapse.state`. ([\#11004](#11004)) - Remove the deprecated `BaseHandler` object. ([\#11005](#11005)) - Bump mypy version for CI to 0.910, and pull in new type stubs for dependencies. ([\#11006](#11006)) - Fix CI to run the unit tests without optional deps. ([\#11017](#11017)) - Ensure that cache config tests do not share state. ([\#11019](#11019)) - Add additional type hints to `synapse.server_notices`. ([\#11021](#11021)) - Add additional type hints for `synapse.push`. ([\#11023](#11023)) - When installing the optional developer dependencies, also include the dependencies needed for type-checking and unit testing. ([\#11034](#11034)) - Remove unnecessary list comprehension from `synapse_port_db` to satisfy code style requirements. ([\#11043](#11043))
2 parents 65df33e + 95813ff commit 9994998

File tree

266 files changed

+6046
-2557
lines changed

Some content is hidden

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

266 files changed

+6046
-2557
lines changed

.ci/scripts/test_synapse_port_db.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
2525
echo "--- Prepare test database"
2626

2727
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
28-
scripts-dev/update_database --database-config .ci/sqlite-config.yaml
28+
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
2929

3030
# Create the PostgreSQL database.
3131
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
@@ -46,7 +46,7 @@ echo "--- Prepare empty SQLite database"
4646
# we do this by deleting the sqlite db, and then doing the same again.
4747
rm .ci/test_db.db
4848

49-
scripts-dev/update_database --database-config .ci/sqlite-config.yaml
49+
scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
5050

5151
# re-create the PostgreSQL database.
5252
.ci/scripts/postgres_exec.py \

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Automatically request reviews from the synapse-core team when a pull request comes in.
2+
* @matrix-org/synapse-core

.github/workflows/tests.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,25 @@ jobs:
7676
runs-on: ubuntu-latest
7777
strategy:
7878
matrix:
79-
python-version: ["3.6", "3.7", "3.8", "3.9"]
79+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
8080
database: ["sqlite"]
81+
toxenv: ["py"]
8182
include:
8283
# Newest Python without optional deps
83-
- python-version: "3.9"
84-
toxenv: "py-noextras,combine"
84+
- python-version: "3.10"
85+
toxenv: "py-noextras"
8586

8687
# Oldest Python with PostgreSQL
8788
- python-version: "3.6"
8889
database: "postgres"
8990
postgres-version: "9.6"
91+
toxenv: "py"
9092

91-
# Newest Python with PostgreSQL
92-
- python-version: "3.9"
93+
# Newest Python with newest PostgreSQL
94+
- python-version: "3.10"
9395
database: "postgres"
94-
postgres-version: "13"
96+
postgres-version: "14"
97+
toxenv: "py"
9598

9699
steps:
97100
- uses: actions/checkout@v2
@@ -111,7 +114,7 @@ jobs:
111114
if: ${{ matrix.postgres-version }}
112115
timeout-minutes: 2
113116
run: until pg_isready -h localhost; do sleep 1; done
114-
- run: tox -e py,combine
117+
- run: tox -e ${{ matrix.toxenv }}
115118
env:
116119
TRIAL_FLAGS: "--jobs=2"
117120
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
@@ -169,7 +172,7 @@ jobs:
169172
with:
170173
python-version: ${{ matrix.python-version }}
171174
- run: pip install tox
172-
- run: tox -e py,combine
175+
- run: tox -e py
173176
env:
174177
TRIAL_FLAGS: "--jobs=2"
175178
- name: Dump logs
@@ -256,8 +259,8 @@ jobs:
256259
- python-version: "3.6"
257260
postgres-version: "9.6"
258261

259-
- python-version: "3.9"
260-
postgres-version: "13"
262+
- python-version: "3.10"
263+
postgres-version: "14"
261264

262265
services:
263266
postgres:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ __pycache__/
4040
/.coverage*
4141
/.mypy_cache/
4242
/.tox
43+
/.tox-pg-container
4344
/build/
4445
/coverage.*
4546
/dist/

CHANGES.md

+238

README.rst

+4-7

changelog.d/10659.misc

-1
This file was deleted.

changelog.d/10690.bugfix

-1
This file was deleted.

changelog.d/10776.feature

-1
This file was deleted.

changelog.d/10777.misc

-1
This file was deleted.

changelog.d/10782.bugfix

-1
This file was deleted.

changelog.d/10785.misc

-1
This file was deleted.

changelog.d/10796.misc

-1
This file was deleted.

changelog.d/10807.bugfix

-1
This file was deleted.

changelog.d/10810.bugfix

-1
This file was deleted.

changelog.d/10812.misc

-1
This file was deleted.

changelog.d/10814.feature

-1
This file was deleted.

changelog.d/10815.misc

-1
This file was deleted.

changelog.d/10816.misc

-1
This file was deleted.

changelog.d/10817.misc

-1
This file was deleted.

changelog.d/10819.feature

-1
This file was deleted.

changelog.d/10820.misc

-1
This file was deleted.

changelog.d/10823.misc

-1
This file was deleted.

changelog.d/10826.misc

-2
This file was deleted.

changelog.d/10827.bugfix

-1
This file was deleted.

changelog.d/10829.misc

-1
This file was deleted.

changelog.d/10831.misc

-1
This file was deleted.

changelog.d/10833.misc

-1
This file was deleted.

changelog.d/10834.misc

-1
This file was deleted.

changelog.d/10835.misc

-1
This file was deleted.

changelog.d/10838.misc

-1
This file was deleted.

changelog.d/10839.misc

-1
This file was deleted.

changelog.d/10843.bugfix

-1
This file was deleted.

changelog.d/10845.doc

-1
This file was deleted.

changelog.d/10856.misc

-1
This file was deleted.

changelog.d/10859.bugfix

-1
This file was deleted.

changelog.d/10865.doc

-1
This file was deleted.

changelog.d/10867.misc

-1
This file was deleted.

changelog.d/10868.feature

-1
This file was deleted.

changelog.d/10869.doc

-1
This file was deleted.

changelog.d/10873.bugfix

-1
This file was deleted.

changelog.d/10875.bugfix

-1
This file was deleted.

changelog.d/10879.misc

-1
This file was deleted.

changelog.d/10880.misc

-1
This file was deleted.

changelog.d/10881.bugfix

-1
This file was deleted.

changelog.d/10883.misc

-1
This file was deleted.

changelog.d/10884.misc

-1
This file was deleted.

changelog.d/10885.misc

-1
This file was deleted.

changelog.d/10887.bugfix

-1
This file was deleted.

changelog.d/10889.misc

-1
This file was deleted.

changelog.d/10891.misc

-1
This file was deleted.

changelog.d/10893.misc

-1
This file was deleted.

changelog.d/10896.misc

-1
This file was deleted.

changelog.d/10897.misc

-1
This file was deleted.

changelog.d/10901.misc

-1
This file was deleted.

changelog.d/10907.bugfix

-1
This file was deleted.

debian/changelog

+46
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
matrix-synapse-py3 (1.45.0) stable; urgency=medium
2+
3+
* New synapse release 1.45.0.
4+
5+
-- Synapse Packaging team <packages@matrix.org> Tue, 19 Oct 2021 11:18:53 +0100
6+
7+
matrix-synapse-py3 (1.45.0~rc2) stable; urgency=medium
8+
9+
* New synapse release 1.45.0~rc2.
10+
11+
-- Synapse Packaging team <packages@matrix.org> Thu, 14 Oct 2021 10:58:24 +0100
12+
13+
matrix-synapse-py3 (1.45.0~rc1) stable; urgency=medium
14+
15+
[ Nick @ Beeper ]
16+
* Include an `update_synapse_database` script in the distribution.
17+
18+
[ Synapse Packaging team ]
19+
* New synapse release 1.45.0~rc1.
20+
21+
-- Synapse Packaging team <packages@matrix.org> Tue, 12 Oct 2021 10:46:27 +0100
22+
23+
matrix-synapse-py3 (1.44.0) stable; urgency=medium
24+
25+
* New synapse release 1.44.0.
26+
27+
-- Synapse Packaging team <packages@matrix.org> Tue, 05 Oct 2021 13:43:57 +0100
28+
29+
matrix-synapse-py3 (1.44.0~rc3) stable; urgency=medium
30+
31+
* New synapse release 1.44.0~rc3.
32+
33+
-- Synapse Packaging team <packages@matrix.org> Mon, 04 Oct 2021 14:57:22 +0100
34+
35+
matrix-synapse-py3 (1.44.0~rc2) stable; urgency=medium
36+
37+
* New synapse release 1.44.0~rc2.
38+
39+
-- Synapse Packaging team <packages@matrix.org> Thu, 30 Sep 2021 12:39:10 +0100
40+
41+
matrix-synapse-py3 (1.44.0~rc1) stable; urgency=medium
42+
43+
* New synapse release 1.44.0~rc1.
44+
45+
-- Synapse Packaging team <packages@matrix.org> Tue, 28 Sep 2021 13:41:28 +0100
46+
147
matrix-synapse-py3 (1.43.0) stable; urgency=medium
248

349
* New synapse release 1.43.0.

debian/matrix-synapse-py3.links

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ opt/venvs/matrix-synapse/bin/register_new_matrix_user usr/bin/register_new_matri
33
opt/venvs/matrix-synapse/bin/synapse_port_db usr/bin/synapse_port_db
44
opt/venvs/matrix-synapse/bin/synapse_review_recent_signups usr/bin/synapse_review_recent_signups
55
opt/venvs/matrix-synapse/bin/synctl usr/bin/synctl
6+
opt/venvs/matrix-synapse/bin/update_synapse_database usr/bin/update_synapse_database

docker/Dockerfile-dhvirtualenv

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ RUN apt-get update -qq -o Acquire::Languages=none \
4747
&& cd /dh-virtualenv \
4848
&& env DEBIAN_FRONTEND=noninteractive mk-build-deps -ri -t "apt-get -y --no-install-recommends"
4949

50-
# build it
51-
RUN cd /dh-virtualenv && dpkg-buildpackage -us -uc -b
50+
# Build it. Note that building the docs doesn't work due to differences in
51+
# Sphinx APIs across versions/distros.
52+
RUN cd /dh-virtualenv && DEB_BUILD_OPTIONS=nodoc dpkg-buildpackage -us -uc -b
5253

5354
###
5455
### Stage 1

docker/Dockerfile-pgtests

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
# Use the Sytest image that comes with a lot of the build dependencies
22
# pre-installed
3-
FROM matrixdotorg/sytest:latest
3+
FROM matrixdotorg/sytest:bionic
44

55
# The Sytest image doesn't come with python, so install that
66
RUN apt-get update && apt-get -qq install -y python3 python3-dev python3-pip
77

88
# We need tox to run the tests in run_pg_tests.sh
99
RUN python3 -m pip install tox
1010

11-
ADD run_pg_tests.sh /pg_tests.sh
12-
ENTRYPOINT /pg_tests.sh
11+
# Initialise the db
12+
RUN su -c '/usr/lib/postgresql/10/bin/initdb -D /var/lib/postgresql/data -E "UTF-8" --lc-collate="C.UTF-8" --lc-ctype="C.UTF-8" --username=postgres' postgres
13+
14+
# Add a user with our UID and GID so that files get created on the host owned
15+
# by us, not root.
16+
ARG UID
17+
ARG GID
18+
RUN groupadd --gid $GID user
19+
RUN useradd --uid $UID --gid $GID --groups sudo --no-create-home user
20+
21+
# Ensure we can start postgres by sudo-ing as the postgres user.
22+
RUN apt-get update && apt-get -qq install -y sudo
23+
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
24+
25+
ADD run_pg_tests.sh /run_pg_tests.sh
26+
# Use the "exec form" of ENTRYPOINT (https://docs.docker.com/engine/reference/builder/#entrypoint)
27+
# so that we can `docker run` this container and pass arguments to pg_tests.sh
28+
ENTRYPOINT ["/run_pg_tests.sh"]
29+
30+
USER user

docker/run_pg_tests.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ set -e
1010
# Set PGUSER so Synapse's tests know what user to connect to the database with
1111
export PGUSER=postgres
1212

13-
# Initialise & start the database
14-
su -c '/usr/lib/postgresql/9.6/bin/initdb -D /var/lib/postgresql/data -E "UTF-8" --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8" --username=postgres' postgres
15-
su -c '/usr/lib/postgresql/9.6/bin/pg_ctl -w -D /var/lib/postgresql/data start' postgres
13+
# Start the database
14+
sudo -u postgres /usr/lib/postgresql/10/bin/pg_ctl -w -D /var/lib/postgresql/data start
1615

1716
# Run the tests
1817
cd /src
1918
export TRIAL_FLAGS="-j 4"
20-
tox --workdir=/tmp -e py35-postgres
19+
tox --workdir=./.tox-pg-container -e py36-postgres "$@"

docs/MSC1711_certificates_FAQ.md

+2-2

docs/README.md

+3-3

0 commit comments

Comments
 (0)