Commit graph

5765 commits

Author SHA1 Message Date
Patrick Cloke 185da8f0f2
Misc. clean-ups to the relations code (#12519)
* Corrects some typos / copy & paste errors in tests.
* Clarifies docstrings.
* Removes an unnecessary method.
2022-04-25 08:25:56 -04:00
villepeh d9b71410c2
Add HAProxy delegation example to docs (#12501)
Signed-off-by: Ville Petteri Huh
2022-04-25 13:18:18 +01:00
Dirk Klimpel a36a38b1ca
Add some example configurations for worker (#12492)
Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
2022-04-25 13:17:03 +01:00
Sean Quah a50fb411b3
Update delay_cancellation to accept any awaitable (#12468)
This will mainly be useful when dealing with module callbacks, which are
all typed as returning `Awaitable`s instead of coroutines or
`Deferred`s.

Signed-off-by: Sean Quah <seanq@element.io>
2022-04-22 18:20:06 +01:00
Will Hunt b82fff66df
MSC3202: Fix device_unused_fallback_keys -> device_unused_fallback_key_types (#12520)
* Fix device_unused_fallback_keys -> device_unused_fallback_key_types

* changelog
2022-04-22 16:03:46 +01:00
Richard van der Hoff f5668f0b4a
Await un-partial-stating after a partial-state join (#12399)
When we join a room via the faster-joins mechanism, we end up with "partial
state" at some points on the event DAG. Many parts of the codebase need to
wait for the full state to load. So, we implement a mechanism to keep track of
which events have partial state, and wait for them to be fully-populated.
2022-04-21 07:42:03 +01:00
David Robertson 09b4f6e46d
Remove leftover references to setup.py (#12514)
* Remove leftover references to setup.py

Missed in #12478.

* Changelog
2022-04-20 18:16:49 +00:00
David Robertson e5a76ec00b
Dump setuptools; correct pyproject version number (#12478) 2022-04-20 17:33:20 +01:00
Patrick Cloke 103f51d867
Fix Jinja templating error when generating thumbnail URLs. (#12510)
scale is meant to be a constant string, not refer to a variable.
2022-04-20 12:03:03 -04:00
David Robertson ecef741add
Recommend poetry in docs (#12475)
* Recommend poetry in docs

- readme
- contributor guide
- upgrade notes
- new dev cheat sheet for poetry

Co-authored-by: Shay <hillerys@element.io>
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-04-20 15:18:21 +01:00
Patrick Cloke d0c1f4ca4c
Remove unnecessary config overrides for MSC3666. (#12511) 2022-04-20 09:56:59 -04:00
Tulir Asokan 4bc8cb4669
Implement MSC2815: allow room moderators to view redacted event content (#12427)
Implements matrix-org/matrix-spec-proposals#2815

Signed-off-by: Tulir Asokan <tulir@maunium.net>
2022-04-20 12:57:39 +01:00
David Robertson eed38c5027
Add CI job to act as a canary for testing against latest dependencies (#12472)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-04-20 12:48:44 +01:00
Erik Johnston c1482a352a
Fix returned count of delete extremities admin API (#12496) 2022-04-19 16:49:45 +01:00
Richard van der Hoff b80bb7e452
Fix /room/.../event/... to return the *original* event after any edits (#12476)
This is what the MSC (now) requires. Fixes https://github.com/matrix-org/synapse/issues/10310.
2022-04-19 16:42:19 +01:00
Richard van der Hoff 798deb3a10
Fix typo in deb changelogs from release script (#12497)
The release script used to incorrectly write `New synapse release 1.57.0~rc1.`
instead of `New synapse release 1.57.0rc1.`
2022-04-19 16:41:52 +01:00
Jan Christian Grünhage a1f87f57ff
Implement MSC3383: include destination in X-Matrix auth header (#11398)
Co-authored-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
Co-authored-by: Marcus Hoffmann <bubu@bubu1.eu>
2022-04-19 16:23:53 +01:00
Dirk Klimpel fbdee86004
Fix a link in README.rst (#12495)
* Fix a link in `README.rst`

* newsfile
2022-04-19 13:00:41 +00:00
Richard van der Hoff b121a3ad2b
Back out implementation of MSC2314 (#12474)
MSC2314 has now been closed, so we're backing out its implementation, which
originally happened in #6176.

Unfortunately it's not a direct revert, as that PR mixed in a bunch of
unrelated changes to tests etc.
2022-04-19 11:17:29 +00:00
Travis Ralston f8d3ee9570
Fix grammatical error in error message (#12483)
* Fix grammatical error in error message

* changelog
2022-04-18 12:41:55 -06:00
Shay 3c758d9808
Add a manual documenting config file options (#12368) 2022-04-18 11:32:30 -07:00
Richard van der Hoff aaaff98202
Dockerfile-workers: reduce the amount we install (#12464)
This is an attempt to reduce the rebuild time. In short, we reduce the amount
of stuff that the dockerfile installs, so as to give a faster startup.
2022-04-14 15:36:49 +01:00
reivilibre 7efddbebef
Update documentation to reflect that run_background_tasks_on is no longer experimental. (#12451)
* Background workers aren't experimental anymore

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

* Stream writers aren't experimental either
2022-04-14 15:25:22 +01:00
Richard van der Hoff 960b4fb409
complement-synapse-workers: factor out separate entry point script (#12467)
... with a bit more verbosity.
2022-04-14 14:56:10 +01:00
Dirk Klimpel a743f7d33e
Replace federation_reader with generic_worker in docs (#12457) 2022-04-14 13:09:07 +01:00
Erik Johnston 0b014eb25e
Only send out device list updates for our own users (#12465)
Broke in #12365
2022-04-14 13:05:31 +01:00
David Robertson 535a689cfc
Reintroduce the lint targets in the linter script (#12455) 2022-04-14 11:33:06 +01:00
David Robertson 6b3e0ea6bd
Use poetry to manage the virtualenv in debian packages (#12449)
* Use `poetry` to build venv in debian packages

Co-authored-by: Dan Callahan <danc@element.io>
Co-authored-by: Shay <hillerys@element.io>

* Changelog

* Only pull in from requirements.txt

Addresses the same problem as #12439.

* Include `test` and `all` extras

`poetry export` helpfully silently ignores an unknown extra

Haven't seen this before because it's the only place we export `all` and
`test`. I could have __sworm__ that the syntax `--extra "all test"`
worked for `poetry install`...

* Clean up requirements file on subsequence builds

* Fix shell syntax

Co-authored-by: Dan Callahan <danc@element.io>
Co-authored-by: Shay <hillerys@element.io>
2022-04-14 11:03:24 +01:00
Richard van der Hoff 8af8a9bce5
Dockerfile-workers: give the master its own log config (#12466)
When we run a worker-mode synapse under docker, everything gets logged to stdout. Currently, output from the workers is tacked with a worker name, for example:

```
2022-04-13 15:27:56,810 - worker:frontend_proxy1 - synapse.util.caches.lrucache - 154 - INFO - LruCache._expire_old_entries-0 - Dropped 0 items from caches
```

- note `worker:frontend_proxy1`. No such tag is applied to log lines from the master, which makes somewhat confusing reading.

To fix this, we generate a dedicated log config file for the master in the same way that we do for the workers, and use that.
2022-04-13 20:50:08 +01:00
Shay 8e2759f2d8
Limit device_id size to 512B (#12454)
*
2022-04-13 10:04:01 -07:00
Andrew Morgan 0922462fc7
docs: Don't render the table of contents on the print page (#12340) 2022-04-13 08:27:51 -07:00
David Baker 73d8ded0b0
Prevent a sync request from removing a user's busy presence status (#12213)
In trying to use the MSC3026 busy presence status, the user's status
would be set back to 'online' next time they synced. This change makes
it so that syncing does not affect a user's presence status if it
is currently set to 'busy': it must be removed through the presence
API.

The MSC defers to implementations on the behaviour of busy presence,
so this ought to remain compatible with the MSC.
2022-04-13 16:21:07 +01:00
Nick Mills-Barrett e3a49f4784
Fix missing sync events during historical batch imports (#12319)
Discovered after much in-depth investigation in #12281.

Closes: #12281
Closes: #3305

Signed off by: Nick Mills-Barrett nick@beeper.com
2022-04-13 11:38:35 +01:00
David Robertson d24cd17820
Use poetry lockfile in twisted trunk CI job (#12425)
Fixes #12458

Co-authored-by: Sean Quah <seanq@element.io>
Co-authored-by: Dan Callahan <danc@element.io>
2022-04-13 11:26:53 +01:00
Jonathan de Jong 36d8b83888
Rename Mutual Rooms unstable_features flag to match MSC (#12445)
Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
2022-04-13 10:32:44 +01:00
Shay 32545d2e26
Bump twisted version to the latest in lockfile (#12441) 2022-04-12 13:46:55 -07:00
David Robertson 5a275a2377
Run "main" trial tests under poetry (#12438)
* Run "main" trial tests under poetry

Olddeps and twisted trunk tests are handled in separate PRs.

The PyPy config is a best-effort only; it's completely untested.

Pulled out from #12337.

* Changelog
2022-04-12 17:41:21 +01:00
David Robertson 58c657322a
Run lints under poetry in CI; remove lint tox jobs (#12434)
Co-authored-by: Dan Callahan <danc@element.io>
2022-04-12 17:35:48 +01:00
Erik Johnston aa28110264
Process device list updates asynchronously (#12365) 2022-04-12 16:50:40 +01:00
Patrick Cloke 4bdbebccb9
Remove the unstable event field for /send_join per MSC3083. (#12395)
This was missed when initially stabilising room version 8 and was
left in as a compatibility shim. Most homeservers have upgraded
to a version which expects the proper field name, and the failure
mode is reasonable (a user on an older server may have to attempt
joining the room twice with an obscure error message the first time).
2022-04-12 11:27:45 -04:00
Erik Johnston ba1588461b
Fix typos in release script docs (#12450) 2022-04-12 15:12:57 +00:00
Erik Johnston a468768104 Merge branch 'release-v1.57' into develop 2022-04-12 15:28:41 +01:00
Patrick Cloke 9535fd0f9c
Disable groups/communities by default. (#12344)
This disables the endpoints (and sync response fields) for
groups/communities by default.
2022-04-12 10:20:46 -04:00
Richard van der Hoff 320186319a
Resync state after partial-state join (#12394)
We work through all the events with partial state, updating the state at each
of them. Once it's done, we recalculate the state for the whole room, and then
mark the room as having complete state.
2022-04-12 13:23:43 +00:00
Patrick Cloke 86cf6a3a17
Remove references to unstable identifiers from MSC3440. (#12382)
Removes references to unstable thread relation, unstable
identifiers for filtering parameters, and the experimental
config flag.
2022-04-12 08:42:03 -04:00
Erik Johnston 641f43ba81 1.57.0rc1 2022-04-12 13:39:35 +01:00
Dirk Klimpel 1783156dbc
Add some type hints to datastore (#12423)
* Add some type hints to datastore

* newsfile

* change `Collection` to `List`

* refactor return type of `select_users_txn`

* correct type hint in `stream.py`

* Remove `Optional` in `select_users_txn`

* remove not needed return type in `__init__`

* Revert change in `get_stream_id_for_event_txn`

* Remove import from `Literal`
2022-04-12 11:54:00 +01:00
David Robertson 4e13743738
Poetry: select olddeps using poetry (#12407)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-04-12 10:50:11 +00:00
Erik Johnston 3ad74b63e5
Specify tls extra for Twisted dependency. (#12444)
* Specify `tls` extra for Twisted dependency.

It was already pulled in for us by `treq`, but we should be explicit
that we do use the `tls` functionality of Twisted directly.

* Mark `idna` as dev-dependency

This doesn't actually change anything, as `Twisted[tls]` will put it in
as a main dependency anyway.
2022-04-12 10:49:02 +00:00
David Robertson 5f8173dd80
Workaround pip bug installing latest treq and not-latest twisted from hashes (#12439)
The requirements file generated by `poetry export` isn't correctly processed by `pip install -r requirements.txt`. It contains twisted and treq, both pinned to 22.2.0.

When `pip` installs treq, it notices that `Twisted[tls]` is required. It then tries to acquire the latest twisted release, only to fail (because this hash isn't listed in the requirements file).From e.g. https://github.com/matrix-org/synapse/runs/5977154990?check_suite_focus=true

> ```
> #15 9.204 Collecting Twisted[tls]>=18.7.0
> #15 9.205 ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
> #15 9.205     Twisted[tls]>=18.7.0 from 38622ff95b/Twisted-22.4.0-py3-none-any.whl (sha256)=f9f7a91f94932477a9fc3b169d57f54f96c6e74a23d78d9ce54039a7f48928a2 (from treq==22.2.0->-r /synapse/requirements.txt (line 724))
> #15 ERROR: executor failed running [/bin/sh -c pip install --prefix="/install" --no-warn-script-location -r /synapse/requirements.txt]: exit code: 1
> ```

The underlying pip issue is https://github.com/pypa/pip/issues/9644. A comment notes that one can avoid this behaviour with by `pip install`ing with the `--no-deps` flag. Let us do so.

(At first glance, the problem looks like https://github.com/python-poetry/poetry/issues/5311, but that was a bug in `poetry install`; this is `poetry export`, whose behaviour is fine AFAICS).
2022-04-12 10:16:01 +01:00