This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v1.74.0rc1' into rei/uvloop
Synapse 1.74.0rc1 (2022-12-13) ============================== Features -------- - Improve user search for international display names. ([\#14464](#14464)) - Stop using deprecated `keyIds` parameter when calling `/_matrix/key/v2/server`. ([\#14490](#14490), [\#14525](#14525)) - Add new `push.enabled` config option to allow opting out of push notification calculation. ([\#14551](#14551), [\#14619](#14619)) - Advertise support for Matrix 1.5 on `/_matrix/client/versions`. ([\#14576](#14576)) - Improve opentracing and logging for to-device message handling. ([\#14598](#14598)) - Allow selecting "prejoin" events by state keys in addition to event types. ([\#14642](#14642)) Bugfixes -------- - Fix a long-standing bug where a device list update might not be sent to clients in certain circumstances. ([\#14435](#14435), [\#14592](#14592), [\#14604](#14604)) - Suppress a spurious warning when `POST /rooms/<room_id>/<membership>/`, `POST /join/<room_id_or_alias`, or the unspecced `PUT /join/<room_id_or_alias>/<txn_id>` receive an empty HTTP request body. ([\#14600](#14600)) - Return spec-compliant JSON errors when unknown endpoints are requested. ([\#14620](#14620), [\#14621](#14621)) - Update html templates to load images over HTTPS. Contributed by @ashfame. ([\#14625](#14625)) - Fix a long-standing bug where the user directory would return 1 more row than requested. ([\#14631](#14631)) - Reject invalid read receipt requests with empty room or event IDs. Contributed by Nick @ Beeper (@Fizzadar). ([\#14632](#14632)) - Fix a bug introduced in Synapse 1.67.0 where not specifying a config file or a server URL would lead to the `register_new_matrix_user` script failing. ([\#14637](#14637)) - Fix a long-standing bug where the user directory and room/user stats might be out of sync. ([\#14639](#14639), [\#14643](#14643)) - Fix a bug introduced in Synapse 1.72.0 where the background updates to add non-thread unique indexes on receipts would fail if they were previously interrupted. ([\#14650](#14650)) - Improve validation of field size limits in events. ([\#14664](#14664)) - Fix bugs introduced in Synapse 1.55.0 and 1.69.0 where application services would not be notified of events in the correct rooms, due to stale caches. ([\#14670](#14670)) Improved Documentation ---------------------- - Update worker settings for `pusher` and `federation_sender` functionality. ([\#14493](#14493)) - Add links to third party package repositories, and point to the bug which highlights Ubuntu's out-of-date packages. ([\#14517](#14517)) - Remove old, incorrect minimum postgres version note and replace with a link to the [Dependency Deprecation Policy](https://matrix-org.github.io/synapse/v1.73/deprecation_policy.html). ([\#14590](#14590)) - Add Single-Sign On setup instructions for Mastodon-based instances. ([\#14594](#14594)) - Change `turn_allow_guests` example value to lowercase `true`. ([\#14634](#14634)) Internal Changes ---------------- - Optimise push badge count calculations. Contributed by Nick @ Beeper (@Fizzadar). ([\#14255](#14255)) - Faster remote room joins: stream the un-partial-stating of rooms over replication. ([\#14473](#14473), [\#14474](#14474)) - Share the `ClientRestResource` for both workers and the main process. ([\#14528](#14528)) - Add `--editable` flag to `complement.sh` which uses an editable install of Synapse for faster turn-around times whilst developing iteratively. ([\#14548](#14548)) - Faster joins: use servers list approximation to send read receipts when in partial state instead of waiting for the full state of the room. ([\#14549](#14549)) - Modernize unit tests configuration related to workers. ([\#14568](#14568)) - Bump jsonschema from 4.17.0 to 4.17.3. ([\#14591](#14591)) - Fix Rust lint CI. ([\#14602](#14602)) - Bump JasonEtco/create-an-issue from 2.5.0 to 2.8.1. ([\#14607](#14607)) - Alter some unit test environment parameters to decrease time spent running tests. ([\#14610](#14610)) - Switch to Go recommended installation method for `gotestfmt` template in CI. ([\#14611](#14611)) - Bump phonenumbers from 8.13.0 to 8.13.1. ([\#14612](#14612)) - Bump types-setuptools from 65.5.0.3 to 65.6.0.1. ([\#14613](#14613)) - Bump twine from 4.0.1 to 4.0.2. ([\#14614](#14614)) - Bump types-requests from 2.28.11.2 to 2.28.11.5. ([\#14615](#14615)) - Bump cryptography from 38.0.3 to 38.0.4. ([\#14616](#14616)) - Remove useless cargo install with apt from Dockerfile. ([\#14636](#14636)) - Bump certifi from 2021.10.8 to 2022.12.7. ([\#14645](#14645)) - Bump flake8-bugbear from 22.10.27 to 22.12.6. ([\#14656](#14656)) - Bump packaging from 21.3 to 22.0. ([\#14657](#14657)) - Bump types-pillow from 9.3.0.1 to 9.3.0.4. ([\#14658](#14658)) - Bump serde from 1.0.148 to 1.0.150. ([\#14659](#14659)) - Bump phonenumbers from 8.13.1 to 8.13.2. ([\#14660](#14660)) - Bump authlib from 1.1.0 to 1.2.0. ([\#14661](#14661)) - Move `StateFilter` to `synapse.types`. ([\#14668](#14668)) - Improve type hints. ([\#14597](#14597), [\#14646](#14646), [\#14671](#14671))
- Loading branch information
Showing
480 changed files
with
19,816 additions
and
9,216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2022 The Matrix.org Foundation C.I.C. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Wraps `auditwheel repair` to first check if we're repairing a potentially abi3 | ||
# compatible wheel, if so rename the wheel before repairing it. | ||
|
||
import argparse | ||
import os | ||
import subprocess | ||
from typing import Optional | ||
from zipfile import ZipFile | ||
|
||
from packaging.tags import Tag | ||
from packaging.utils import parse_wheel_filename | ||
from packaging.version import Version | ||
|
||
|
||
def check_is_abi3_compatible(wheel_file: str) -> None: | ||
"""Check the contents of the built wheel for any `.so` files that are *not* | ||
abi3 compatible. | ||
""" | ||
|
||
with ZipFile(wheel_file, "r") as wheel: | ||
for file in wheel.namelist(): | ||
if not file.endswith(".so"): | ||
continue | ||
|
||
if not file.endswith(".abi3.so"): | ||
raise Exception(f"Found non-abi3 lib: {file}") | ||
|
||
|
||
def cpython(wheel_file: str, name: str, version: Version, tag: Tag) -> str: | ||
"""Replaces the cpython wheel file with a ABI3 compatible wheel""" | ||
|
||
if tag.abi == "abi3": | ||
# Nothing to do. | ||
return wheel_file | ||
|
||
check_is_abi3_compatible(wheel_file) | ||
|
||
abi3_tag = Tag(tag.interpreter, "abi3", tag.platform) | ||
|
||
dirname = os.path.dirname(wheel_file) | ||
new_wheel_file = os.path.join( | ||
dirname, | ||
f"{name}-{version}-{abi3_tag}.whl", | ||
) | ||
|
||
os.rename(wheel_file, new_wheel_file) | ||
|
||
print("Renamed wheel to", new_wheel_file) | ||
|
||
return new_wheel_file | ||
|
||
|
||
def main(wheel_file: str, dest_dir: str, archs: Optional[str]) -> None: | ||
"""Entry point""" | ||
|
||
# Parse the wheel file name into its parts. Note that `parse_wheel_filename` | ||
# normalizes the package name (i.e. it converts matrix_synapse -> | ||
# matrix-synapse), which is not what we want. | ||
_, version, build, tags = parse_wheel_filename(os.path.basename(wheel_file)) | ||
name = os.path.basename(wheel_file).split("-")[0] | ||
|
||
if len(tags) != 1: | ||
# We expect only a wheel file with only a single tag | ||
raise Exception(f"Unexpectedly found multiple tags: {tags}") | ||
|
||
tag = next(iter(tags)) | ||
|
||
if build: | ||
# We don't use build tags in Synapse | ||
raise Exception(f"Unexpected build tag: {build}") | ||
|
||
# If the wheel is for cpython then convert it into an abi3 wheel. | ||
if tag.interpreter.startswith("cp"): | ||
wheel_file = cpython(wheel_file, name, version, tag) | ||
|
||
# Finally, repair the wheel. | ||
if archs is not None: | ||
# If we are given archs then we are on macos and need to use | ||
# `delocate-listdeps`. | ||
subprocess.run(["delocate-listdeps", wheel_file], check=True) | ||
subprocess.run( | ||
["delocate-wheel", "--require-archs", archs, "-w", dest_dir, wheel_file], | ||
check=True, | ||
) | ||
else: | ||
subprocess.run(["auditwheel", "repair", "-w", dest_dir, wheel_file], check=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Tag wheel as abi3 and repair it.") | ||
|
||
parser.add_argument( | ||
"--wheel-dir", | ||
"-w", | ||
metavar="WHEEL_DIR", | ||
help="Directory to store delocated wheels", | ||
required=True, | ||
) | ||
|
||
parser.add_argument( | ||
"--require-archs", | ||
metavar="archs", | ||
default=None, | ||
) | ||
|
||
parser.add_argument( | ||
"wheel_file", | ||
metavar="WHEEL_FILE", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
wheel_file = args.wheel_file | ||
wheel_dir = args.wheel_dir | ||
archs = args.require_archs | ||
|
||
main(wheel_file, wheel_dir, archs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
!pyproject.toml | ||
!poetry.lock | ||
!Cargo.lock | ||
!Cargo.toml | ||
!build_rust.py | ||
|
||
rust/target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
root = true | ||
|
||
# 4 space indentation | ||
[*.py] | ||
[*.{py,pyi}] | ||
indent_style = space | ||
indent_size = 4 | ||
max_line_length = 88 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy documentation PR preview | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "Prepare documentation PR preview" ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
netlify: | ||
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action | ||
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess: | ||
- name: 📥 Download artifact | ||
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2 | ||
with: | ||
workflow: docs-pr.yaml | ||
run_id: ${{ github.event.workflow_run.id }} | ||
name: book | ||
path: book | ||
|
||
- name: 📤 Deploy to Netlify | ||
uses: matrix-org/netlify-pr-preview@v1 | ||
with: | ||
path: book | ||
owner: ${{ github.event.workflow_run.head_repository.owner.login }} | ||
branch: ${{ github.event.workflow_run.head_branch }} | ||
revision: ${{ github.event.workflow_run.head_sha }} | ||
token: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
site_id: ${{ secrets.NETLIFY_SITE_ID }} | ||
desc: Documentation preview | ||
deployment_env: PR Documentation Preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Prepare documentation PR preview | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- docs/** | ||
|
||
jobs: | ||
pages: | ||
name: GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup mdbook | ||
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0 | ||
with: | ||
mdbook-version: '0.4.17' | ||
|
||
- name: Build the documentation | ||
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md. | ||
# However, we're using docs/README.md for other purposes and need to pick a new page | ||
# as the default. Let's opt for the welcome page instead. | ||
run: | | ||
mdbook build | ||
cp book/welcome_and_overview.html book/index.html | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: book | ||
path: book | ||
# We'll only use this in a workflow_run, then we're done with it | ||
retention-days: 1 |
Oops, something went wrong.