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

Merge 1.95 #84

Merged
merged 58 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
80ec81d
Some refactors around receipts stream (#16426)
erikjohnston Oct 4, 2023
ab9c1e8
Add type hints to synmark. (#16421)
clokep Oct 4, 2023
009b47b
Factor out `MultiWriter` token from `RoomStreamToken` (#16427)
erikjohnston Oct 5, 2023
4e302b3
Add __slots__ to replication commands. (#16429)
clokep Oct 5, 2023
fa90702
Remove manys calls to cursor_to_dict (#16431)
clokep Oct 5, 2023
3555790
Remove unused method. (#16435)
clokep Oct 5, 2023
5946074
Bump pyo3 from 0.17.1 to 0.19.2 (#16162)
V02460 Oct 6, 2023
26b960b
Register media servlets via regex. (#16419)
clokep Oct 6, 2023
694802e
Add documentation on background updates. (#16420)
clokep Oct 6, 2023
ae5b997
Fix comments related to replication. (#16428)
clokep Oct 6, 2023
fc31b49
Stop sending incorrect knock_state_events. (#16403)
clokep Oct 6, 2023
cabd577
Drop unused tables & unneeded access token ID for events. (#16268)
clokep Oct 6, 2023
7615e2b
Return ThumbnailInfo in more places (#16438)
clokep Oct 6, 2023
06bbf10
Convert simple_select_list_paginate_txn to return tuples. (#16433)
clokep Oct 6, 2023
1f10c20
Apply join rate limiter outside the lineariser (#16441)
Oct 6, 2023
32fd9bc
Fix possible AttributeError when account-api is called over unix sock…
shtrophic Oct 9, 2023
3d2f533
Bump types-bleach from 6.0.0.4 to 6.1.0.0 (#16450)
dependabot[bot] Oct 9, 2023
45738e2
Bump bleach from 6.0.0 to 6.1.0 (#16451)
dependabot[bot] Oct 9, 2023
6fb0c43
Bump psycopg2 from 2.9.8 to 2.9.9 (#16452)
dependabot[bot] Oct 9, 2023
3727b84
Bump netaddr from 0.8.0 to 0.9.0 (#16453)
dependabot[bot] Oct 9, 2023
0a67743
Bump ruff from 0.0.290 to 0.0.292 (#16449)
dependabot[bot] Oct 9, 2023
a6abee3
Don't block CI on sign-off (#16454)
erikjohnston Oct 9, 2023
8902b30
Disable statement timeout whilst purging rooms (#16455)
reivilibre Oct 9, 2023
28fd28e
Add DB indices to speed up purging rooms (#16457)
Oct 10, 2023
b52ad6e
Merge branch 'master' into develop
reivilibre Oct 10, 2023
4f87edc
Add security advisory note to the changelog
reivilibre Oct 10, 2023
336b0b9
Merge branch 'master' into develop
reivilibre Oct 10, 2023
5f12090
Add CVE number for advisory GHSA-5chr-wjw5-3gq4.
clokep Oct 10, 2023
b6cb610
Merge remote-tracking branch 'origin/master' into develop
clokep Oct 10, 2023
f1e4301
Inline simple_search_list/simple_search_list_txn. (#16434)
clokep Oct 10, 2023
d6b7d49
Handle content types with parameters. (#16440)
clokep Oct 11, 2023
a4904dc
Convert simple_select_many_batch, simple_select_many_txn to tuples. (…
clokep Oct 11, 2023
cc865ff
Convert user_get_threepids response to attrs. (#16468)
clokep Oct 12, 2023
f710d54
Update complement.sh to match new public API shape (#16466)
kegsay Oct 12, 2023
4cc729d
Revert "Drop unused tables & unneeded access token ID for events. (#1…
clokep Oct 12, 2023
166ffc0
Fix typo in useful_sql_for_admins.md (#16477)
laurencegill Oct 12, 2023
1098822
Clean up logging on event persister endpoints (#16488)
richvdh Oct 14, 2023
a832212
Bump pyo3-log from 0.8.3 to 0.8.4 (#16495)
dependabot[bot] Oct 16, 2023
b220f82
Bump packaging from 23.1 to 23.2 (#16497)
dependabot[bot] Oct 16, 2023
aaca977
Bump types-jsonschema from 4.17.0.10 to 4.19.0.3 (#16499)
dependabot[bot] Oct 16, 2023
9be4db2
Bump jsonschema from 4.19.0 to 4.19.1 (#16500)
dependabot[bot] Oct 16, 2023
eee6474
Remove useless async job to delete device messages on sync (#16491)
MatMaul Oct 16, 2023
37d9edc
Bump sentry-sdk from 1.31.0 to 1.32.0 (#16496)
dependabot[bot] Oct 16, 2023
7154724
Bump serde from 1.0.188 to 1.0.189 (#16494)
dependabot[bot] Oct 16, 2023
4fe73f8
Bump pillow from 10.0.1 to 10.1.0 (#16498)
dependabot[bot] Oct 16, 2023
e3e0ae4
Convert state delta processing from a dict to attrs. (#16469)
clokep Oct 16, 2023
7291c68
Update the release script to remind releaser to check for special rel…
reivilibre Oct 16, 2023
77dfc1f
Fix a bug where servers could be marked as up when they were failing …
clokep Oct 17, 2023
6ad1f9e
Convert DeviceLastConnectionInfo to attrs. (#16507)
clokep Oct 17, 2023
6e6d611
1.95.0rc1
clokep Oct 17, 2023
c81908b
Update the changelog.
clokep Oct 17, 2023
345c61f
Build Debian packages for Ubuntu 23.10 Mantic Minotaur (#16524)
Oct 19, 2023
79f48b2
1.95.0
Oct 24, 2023
daec55e
Merge pull request from GHSA-mp92-3jfm-3575
clokep Oct 31, 2023
a115119
1.95.1
erikjohnston Oct 31, 2023
215c6c0
Merge tag 'v1.95.1' into merge-1.95
Fizzadar Nov 13, 2023
54f01b8
Fix import order
Fizzadar Nov 13, 2023
350d582
Remove stream token-per-persister removal hack
Fizzadar Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,88 @@
# Synapse 1.95.1 (2023-10-31)

## Security advisory

The following issue is fixed in 1.95.1.

- [GHSA-mp92-3jfm-3575](https://github.com/matrix-org/synapse/security/advisories/GHSA-mp92-3jfm-3575) / [CVE-2023-43796](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43796) — Moderate Severity

Cached device information of remote users can be queried from Synapse. This can be used to enumerate the remote users known to a homeserver.

See the advisory for more details. If you have any questions, email [email protected].



# Synapse 1.95.0 (2023-10-24)

### Internal Changes

- Build Debian packages for [Ubuntu 23.10 Mantic Minotaur](https://canonical.com/blog/canonical-releases-ubuntu-23-10-mantic-minotaur). ([\#16524](https://github.com/matrix-org/synapse/issues/16524))


# Synapse 1.95.0rc1 (2023-10-17)

### Bugfixes

- Remove legacy unspecced `knock_state_events` field returned in some responses. ([\#16403](https://github.com/matrix-org/synapse/issues/16403))
- Fix a bug introduced in Synapse 1.81.0 where an `AttributeError` would be raised when `_matrix/client/v3/account/whoami` is called over a unix socket. Contributed by @Sir-Photch. ([\#16404](https://github.com/matrix-org/synapse/issues/16404))
- Properly return inline media when content types have parameters. ([\#16440](https://github.com/matrix-org/synapse/issues/16440))
- Prevent the purging of large rooms from timing out when Postgres is in use. The timeout which causes this issue was introduced in Synapse 1.88.0. ([\#16455](https://github.com/matrix-org/synapse/issues/16455))
- Improve the performance of purging rooms, particularly encrypted rooms. ([\#16457](https://github.com/matrix-org/synapse/issues/16457))
- Fix a bug introduced in Synapse 1.59.0 where servers could be incorrectly marked as available after an error response was received. ([\#16506](https://github.com/matrix-org/synapse/issues/16506))

### Improved Documentation

- Document internal background update mechanism. ([\#16420](https://github.com/matrix-org/synapse/issues/16420))
- Fix a typo in the sql for [useful SQL for admins document](https://matrix-org.github.io/synapse/latest/usage/administration/useful_sql_for_admins.html). ([\#16477](https://github.com/matrix-org/synapse/issues/16477))

### Internal Changes

- Bump pyo3 from 0.17.1 to 0.19.2. ([\#16162](https://github.com/matrix-org/synapse/issues/16162))
- Update registration of media repository URLs. ([\#16419](https://github.com/matrix-org/synapse/issues/16419))
- Improve type hints. ([\#16421](https://github.com/matrix-org/synapse/issues/16421), [\#16468](https://github.com/matrix-org/synapse/issues/16468), [\#16469](https://github.com/matrix-org/synapse/issues/16469), [\#16507](https://github.com/matrix-org/synapse/issues/16507))
- Refactor some code to simplify and better type receipts stream adjacent code. ([\#16426](https://github.com/matrix-org/synapse/issues/16426))
- Factor out `MultiWriter` token from `RoomStreamToken`. ([\#16427](https://github.com/matrix-org/synapse/issues/16427))
- Improve code comments. ([\#16428](https://github.com/matrix-org/synapse/issues/16428))
- Reduce memory allocations. ([\#16429](https://github.com/matrix-org/synapse/issues/16429), [\#16431](https://github.com/matrix-org/synapse/issues/16431), [\#16433](https://github.com/matrix-org/synapse/issues/16433), [\#16434](https://github.com/matrix-org/synapse/issues/16434), [\#16438](https://github.com/matrix-org/synapse/issues/16438), [\#16444](https://github.com/matrix-org/synapse/issues/16444))
- Remove unused method. ([\#16435](https://github.com/matrix-org/synapse/issues/16435))
- Improve rate limiting logic. ([\#16441](https://github.com/matrix-org/synapse/issues/16441))
- Do not block running of CI behind the check for sign-off on PRs. ([\#16454](https://github.com/matrix-org/synapse/issues/16454))
- Update the release script to remind releaser to check for special release notes. ([\#16461](https://github.com/matrix-org/synapse/issues/16461))
- Update complement.sh to match new public API shape. ([\#16466](https://github.com/matrix-org/synapse/issues/16466))
- Clean up logging on event persister endpoints. ([\#16488](https://github.com/matrix-org/synapse/issues/16488))
- Remove useless async job to delete device messages on sync, since we only deliver (and hence delete) up to 100 device messages at a time. ([\#16491](https://github.com/matrix-org/synapse/issues/16491))

### Updates to locked dependencies

* Bump bleach from 6.0.0 to 6.1.0. ([\#16451](https://github.com/matrix-org/synapse/issues/16451))
* Bump jsonschema from 4.19.0 to 4.19.1. ([\#16500](https://github.com/matrix-org/synapse/issues/16500))
* Bump netaddr from 0.8.0 to 0.9.0. ([\#16453](https://github.com/matrix-org/synapse/issues/16453))
* Bump packaging from 23.1 to 23.2. ([\#16497](https://github.com/matrix-org/synapse/issues/16497))
* Bump pillow from 10.0.1 to 10.1.0. ([\#16498](https://github.com/matrix-org/synapse/issues/16498))
* Bump psycopg2 from 2.9.8 to 2.9.9. ([\#16452](https://github.com/matrix-org/synapse/issues/16452))
* Bump pyo3-log from 0.8.3 to 0.8.4. ([\#16495](https://github.com/matrix-org/synapse/issues/16495))
* Bump ruff from 0.0.290 to 0.0.292. ([\#16449](https://github.com/matrix-org/synapse/issues/16449))
* Bump sentry-sdk from 1.31.0 to 1.32.0. ([\#16496](https://github.com/matrix-org/synapse/issues/16496))
* Bump serde from 1.0.188 to 1.0.189. ([\#16494](https://github.com/matrix-org/synapse/issues/16494))
* Bump types-bleach from 6.0.0.4 to 6.1.0.0. ([\#16450](https://github.com/matrix-org/synapse/issues/16450))
* Bump types-jsonschema from 4.17.0.10 to 4.19.0.3. ([\#16499](https://github.com/matrix-org/synapse/issues/16499))

# Synapse 1.94.0 (2023-10-10)

No significant changes since 1.94.0rc1.
However, please take note of the security advisory that follows.

## Security advisory

The following issue is fixed in 1.94.0 (and RC).

- [GHSA-5chr-wjw5-3gq4](https://github.com/matrix-org/synapse/security/advisories/GHSA-5chr-wjw5-3gq4) / [CVE-2023-45129](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45129) — Moderate Severity

A malicious server ACL event can impact performance temporarily or permanently leading to a persistent denial of service.

Homeservers running on a closed federation (which presumably do not need to use server ACLs) are not affected.

See the advisory for more details. If you have any questions, email [email protected].


# Synapse 1.94.0rc1 (2023-10-03)
Expand Down
40 changes: 20 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
matrix-synapse-py3 (1.95.1) stable; urgency=medium

* New Synapse release 1.95.1.

-- Synapse Packaging team <[email protected]> Tue, 31 Oct 2023 14:00:00 +0000

matrix-synapse-py3 (1.95.0) stable; urgency=medium

* New Synapse release 1.95.0.

-- Synapse Packaging team <[email protected]> Tue, 24 Oct 2023 13:00:46 +0100

matrix-synapse-py3 (1.95.0~rc1) stable; urgency=medium

* New synapse release 1.95.0rc1.

-- Synapse Packaging team <[email protected]> Tue, 17 Oct 2023 15:50:17 +0000

matrix-synapse-py3 (1.94.0) stable; urgency=medium

* New Synapse release 1.94.0.
Expand Down
61 changes: 61 additions & 0 deletions docs/development/database_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,67 @@ def run_upgrade(
...
```

## Background updates

It is sometimes appropriate to perform database migrations as part of a background
process (instead of blocking Synapse until the migration is done). In particular,
this is useful for migrating data when adding new columns or tables.

Pending background updates stored in the `background_updates` table and are denoted
by a unique name, the current status (stored in JSON), and some dependency information:

* Whether the update requires a previous update to be complete.
* A rough ordering for which to complete updates.

A new background updates needs to be added to the `background_updates` table:

```sql
INSERT INTO background_updates (ordering, update_name, depends_on, progress_json) VALUES
(7706, 'my_background_update', 'a_previous_background_update' '{}');
```

And then needs an associated handler in the appropriate datastore:

```python
self.db_pool.updates.register_background_update_handler(
"my_background_update",
update_handler=self._my_background_update,
)
```

There are a few types of updates that can be performed, see the `BackgroundUpdater`:

* `register_background_update_handler`: A generic handler for custom SQL
* `register_background_index_update`: Create an index in the background
* `register_background_validate_constraint`: Validate a constraint in the background
(PostgreSQL-only)
* `register_background_validate_constraint_and_delete_rows`: Similar to
`register_background_validate_constraint`, but deletes rows which don't fit
the constraint.

For `register_background_update_handler`, the generic handler must track progress
and then finalize the background update:

```python
async def _my_background_update(self, progress: JsonDict, batch_size: int) -> int:
def _do_something(txn: LoggingTransaction) -> int:
...
self.db_pool.updates._background_update_progress_txn(
txn, "my_background_update", {"last_processed": last_processed}
)
return last_processed - prev_last_processed

num_processed = await self.db_pool.runInteraction("_do_something", _do_something)
await self.db_pool.updates._end_background_update("my_background_update")

return num_processed
```

Synapse will attempt to rate-limit how often background updates are run via the
given batch-size and the returned number of processed entries (and how long the
function took to run). See
[background update controller callbacks](../modules/background_update_controller_callbacks.md).

## Boolean columns

Boolean columns require special treatment, since SQLite treats booleans the
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/administration/useful_sql_for_admins.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SELECT rss.room_id, rss.name, rss.canonical_alias, rss.topic, rss.encryption,
rsc.joined_members, rsc.local_users_in_room, rss.join_rules
FROM room_stats_state rss
LEFT JOIN room_stats_current rsc USING (room_id)
WHERE room_id IN ( WHERE room_id IN (
WHERE room_id IN (
'!OGEhHVWSdvArJzumhm:matrix.org',
'!YTvKGNlinIzlkMTVRl:matrix.org'
);
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ files =
docker/,
scripts-dev/,
synapse/,
synmark/,
tests/,
build_rust.py

Expand Down Expand Up @@ -80,6 +81,9 @@ ignore_missing_imports = True
[mypy-pympler.*]
ignore_missing_imports = True

[mypy-pyperf.*]
ignore_missing_imports = True

[mypy-rust_python_jaeger_reporter.*]
ignore_missing_imports = True

Expand Down
Loading
Loading