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

Commit f499f40

Browse files
committed
Merge remote-tracking branch 'origin/develop' into rav/faster_joins/02_persist_data
2 parents ad0078f + e24ff8e commit f499f40

File tree

306 files changed

+2679
-775
lines changed

Some content is hidden

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

306 files changed

+2679
-775
lines changed

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# TODO: incorporate this into pyproject.toml if flake8 supports it in the future.
2+
# See https://github.com/PyCQA/flake8/issues/234
3+
[flake8]
4+
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
5+
# for error codes. The ones we ignore are:
6+
# W503: line break before binary operator
7+
# W504: line break after binary operator
8+
# E203: whitespace before ':' (which is contrary to pep8?)
9+
# E731: do not assign a lambda expression, use a def
10+
# E501: Line too long (black enforces this for us)
11+
ignore=W503,W504,E203,E731,E501

.github/workflows/release-artifacts.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# of things breaking (but only build one set of debs)
88
pull_request:
99
push:
10-
branches: ["develop"]
10+
branches: ["develop", "release-*"]
1111

1212
# we do the full build on tags.
1313
tags: ["v*"]
@@ -91,17 +91,7 @@ jobs:
9191

9292
build-sdist:
9393
name: "Build pypi distribution files"
94-
runs-on: ubuntu-latest
95-
steps:
96-
- uses: actions/checkout@v2
97-
- uses: actions/setup-python@v2
98-
- run: pip install wheel
99-
- run: |
100-
python setup.py sdist bdist_wheel
101-
- uses: actions/upload-artifact@v2
102-
with:
103-
name: python-dist
104-
path: dist/*
94+
uses: "matrix-org/backend-meta/.github/workflows/packaging.yml@v1"
10595

10696
# if it's a tag, create a release and attach the artifacts to it
10797
attach-assets:

.github/workflows/tests.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,10 @@ jobs:
4848
env:
4949
PULL_REQUEST_NUMBER: ${{ github.event.number }}
5050

51-
lint-sdist:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions/setup-python@v2
56-
with:
57-
python-version: "3.x"
58-
- run: pip install wheel
59-
- run: python setup.py sdist bdist_wheel
60-
- uses: actions/upload-artifact@v2
61-
with:
62-
name: Python Distributions
63-
path: dist/*
64-
6551
# Dummy step to gate other tests on without repeating the whole list
6652
linting-done:
6753
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
68-
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
54+
needs: [lint, lint-crlf, lint-newsfile]
6955
runs-on: ubuntu-latest
7056
steps:
7157
- run: "true"
@@ -397,7 +383,6 @@ jobs:
397383
- lint
398384
- lint-crlf
399385
- lint-newsfile
400-
- lint-sdist
401386
- trial
402387
- trial-olddeps
403388
- sytest

CHANGES.md

Lines changed: 9 additions & 3 deletions

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ include book.toml
4545
include pyproject.toml
4646
recursive-include changelog.d *
4747

48+
include .flake8
4849
prune .circleci
4950
prune .github
5051
prune .ci

changelog.d/10870.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deduplicate in-flight requests in `_get_state_for_groups`.

changelog.d/11608.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deduplicate in-flight requests in `_get_state_for_groups`.

changelog.d/11900.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove unnecessary condition on knock->leave auth rule check.

changelog.d/11984.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add missing type hints to storage classes.

changelog.d/11985.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fetch images when previewing Twitter URLs. Contributed by @AndrewRyanChama.

changelog.d/12001.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implement experimental support for [MSC3720](https://github.com/matrix-org/matrix-doc/pull/3720) (account status endpoints).

changelog.d/12004.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify information about external Identity Provider IDs.

changelog.d/12009.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable modules to set a custom display name when registering a user.

changelog.d/12013.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Preparation for faster-room-join work: Support for calling `/federation/v1/state` on a remote server.

changelog.d/12016.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug in `StateFilter.return_expanded()` and add some tests.

changelog.d/12018.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for [MSC3283](https://github.com/matrix-org/matrix-doc/pull/3283) unstable flags now that the stable flags are supported.

changelog.d/12019.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use Matrix v1.1 endpoints (`/_matrix/client/v3/auth/...`) in fallback auth HTML forms.

changelog.d/12020.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Advertise Matrix 1.1 support on `/_matrix/client/versions`.

changelog.d/12021.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support only the stable identifier for [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069)'s `is_guest` on `/_matrix/client/v3/account/whoami`.

changelog.d/12022.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Advertise Matrix 1.2 support on `/_matrix/client/versions`.

changelog.d/12024.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix 500 error with Postgres when looking backwards with the [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) `/timestamp_to_event?dir=b` endpoint.

changelog.d/12025.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update the `olddeps` CI job to use an old version of `markupsafe`.

changelog.d/12030.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade mypy to version 0.931.

changelog.d/12031.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove legacy `HomeServer.get_datastore()`.

changelog.d/12033.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deduplicate in-flight requests in `_get_state_for_groups`.

changelog.d/12034.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Minor typing fixes.

changelog.d/12039.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Preparation for faster-room-join work: when parsing the `send_join` response, get the `m.room.create` event from `state`, not `auth_chain`.

changelog.d/12041.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
After joining a room, create a dedicated logcontext to process the queued events.

changelog.d/12051.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Tidy up GitHub Actions config which builds distributions for PyPI.

changelog.d/12052.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move configuration out of `setup.cfg`.

changelog.d/12056.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix slow performance of `/logout` in some cases where refresh tokens are in use. The slowness existed since the initial implementation of refresh tokens.

changelog.d/12058.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use room version 9 as the default room version (per [MSC3589](https://github.com/matrix-org/matrix-doc/pull/3589)).

changelog.d/12059.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move configuration out of `setup.cfg`.

changelog.d/12060.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix error message when a worker process fails to talk to another worker process.

changelog.d/12063.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix using the complement.sh script without specifying a dir or a branch. Contributed by Nico on behalf of Famedly.

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
matrix-synapse-py3 (1.53.0) stable; urgency=medium
2+
3+
* New synapse release 1.53.0.
4+
5+
-- Synapse Packaging team <[email protected]> Tue, 22 Feb 2022 11:32:06 +0000
6+
17
matrix-synapse-py3 (1.53.0~rc1) stable; urgency=medium
28

39
* New synapse release 1.53.0~rc1.

docs/admin_api/user_admin_api.md

Lines changed: 2 additions & 1 deletion

docs/manhole.md

Lines changed: 1 addition & 1 deletion

docs/modules/password_auth_provider_callbacks.md

Lines changed: 31 additions & 4 deletions

docs/sample_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ presence:
163163
# For example, for room version 1, default_room_version should be set
164164
# to "1".
165165
#
166-
#default_room_version: "6"
166+
#default_room_version: "9"
167167

168168
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
169169
#

docs/upgrade.md

Lines changed: 1 addition & 1 deletion

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@ exclude = (?x)
3131
|synapse/storage/databases/main/group_server.py
3232
|synapse/storage/databases/main/metrics.py
3333
|synapse/storage/databases/main/monthly_active_users.py
34-
|synapse/storage/databases/main/presence.py
35-
|synapse/storage/databases/main/purge_events.py
3634
|synapse/storage/databases/main/push_rule.py
3735
|synapse/storage/databases/main/receipts.py
3836
|synapse/storage/databases/main/roommember.py
3937
|synapse/storage/databases/main/search.py
4038
|synapse/storage/databases/main/state.py
41-
|synapse/storage/databases/main/user_directory.py
4239
|synapse/storage/schema/
4340

4441
|tests/api/test_auth.py

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ exclude = '''
5454
)/
5555
)
5656
'''
57+
58+
[tool.isort]
59+
line_length = 88
60+
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "TWISTED", "FIRSTPARTY", "TESTS", "LOCALFOLDER"]
61+
default_section = "THIRDPARTY"
62+
known_first_party = ["synapse"]
63+
known_tests = ["tests"]
64+
known_twisted = ["twisted", "OpenSSL"]
65+
multi_line_output = 3
66+
include_trailing_comma = true
67+
combine_as_imports = true
68+

scripts-dev/complement.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# It makes a Synapse image which represents the current checkout,
66
# builds a synapse-complement image on top, then runs tests with it.
77
#
8-
# By default the script will fetch the latest Complement master branch and
8+
# By default the script will fetch the latest Complement main branch and
99
# run tests with that. This can be overridden to use a custom Complement
1010
# checkout by setting the COMPLEMENT_DIR environment variable to the
1111
# filepath of a local Complement checkout or by setting the COMPLEMENT_REF
@@ -32,7 +32,7 @@ cd "$(dirname $0)/.."
3232

3333
# Check for a user-specified Complement checkout
3434
if [[ -z "$COMPLEMENT_DIR" ]]; then
35-
COMPLEMENT_REF=${COMPLEMENT_REF:-master}
35+
COMPLEMENT_REF=${COMPLEMENT_REF:-main}
3636
echo "COMPLEMENT_DIR not set. Fetching Complement checkout from ${COMPLEMENT_REF}..."
3737
wget -Nq https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz
3838
tar -xzf ${COMPLEMENT_REF}.tar.gz

scripts/update_synapse_database

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MockHomeserver(HomeServer):
4444

4545

4646
def run_background_updates(hs):
47-
store = hs.get_datastore()
47+
store = hs.get_datastores().main
4848

4949
async def run_background_updates():
5050
await store.db_pool.updates.run_background_updates(sleep=False)

setup.cfg

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[trial]
2-
test_suite = tests
3-
41
[check-manifest]
52
ignore =
63
.git-blame-ignore-revs
@@ -10,23 +7,3 @@ ignore =
107
pylint.cfg
118
tox.ini
129

13-
[flake8]
14-
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
15-
# for error codes. The ones we ignore are:
16-
# W503: line break before binary operator
17-
# W504: line break after binary operator
18-
# E203: whitespace before ':' (which is contrary to pep8?)
19-
# E731: do not assign a lambda expression, use a def
20-
# E501: Line too long (black enforces this for us)
21-
ignore=W503,W504,E203,E731,E501
22-
23-
[isort]
24-
line_length = 88
25-
sections=FUTURE,STDLIB,THIRDPARTY,TWISTED,FIRSTPARTY,TESTS,LOCALFOLDER
26-
default_section=THIRDPARTY
27-
known_first_party = synapse
28-
known_tests=tests
29-
known_twisted=twisted,OpenSSL
30-
multi_line_output=3
31-
include_trailing_comma=true
32-
combine_as_imports=true

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def exec_file(path_segments):
103103
]
104104

105105
CONDITIONAL_REQUIREMENTS["mypy"] = [
106-
"mypy==0.910",
107-
"mypy-zope==0.3.2",
106+
"mypy==0.931",
107+
"mypy-zope==0.3.5",
108108
"types-bleach>=4.1.0",
109109
"types-jsonschema>=3.2.0",
110110
"types-opentracing>=2.4.2",

0 commit comments

Comments
 (0)