summary refs log tree commit diff
path: root/changelog.d/12216.misc (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-03-25Add cache for `get_membership_from_event_ids` (#12272)Erik Johnston6-22/+72
This should speed up push rule calculations for rooms with large numbers of local users when the main push rule cache fails. Co-authored-by: reivilibre <oliverw@matrix.org>
2022-03-25Enhance logging for inbound federation events (#12301)Richard van der Hoff2-1/+2
It is currently rather hard to see which rooms are causing inbound federation traffic. Add the room id to the logs.
2022-03-25Refactor `create_new_client_event` to use a new parameter, ↵Eric Eastwood5-65/+165
`state_event_ids`, which accurately describes the usage with MSC2716 instead of abusing `auth_event_ids` (#12083) Spawned from https://github.com/matrix-org/synapse/pull/10975#discussion_r813183430 Part of [MSC2716](https://github.com/matrix-org/matrix-spec-proposals/pull/2716)
2022-03-25Always allow the empty string as an avatar_url. (#12261)David Robertson4-0/+32
Hopefully this fixes #12257. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-03-25Authentik OpenID minor doc update (#12275)IronTooch2-1/+4
2022-03-25Mention the new behaviour on unsafe database locale in the upgrade notes ↵Brendan Abolivier2-0/+8
(#12288) Co-authored-by: Shay <hillerys@element.io>
2022-03-24Re-enable test concurrency on Complement (#12283)kegsay2-1/+2
2022-03-24Remove unused test code. (#12291)Patrick Cloke2-110/+1
The `MockHttpResource` and `MockKey` objects were unused since #9396 (74af356baf79de5d719fad6c32b981eedbdd950d).
2022-03-24changelog v1.55.2Richard van der Hoff1-1/+1
2022-03-241.55.2Richard van der Hoff4-2/+19
2022-03-24Pin Jinja to <3.1.0 (#12297)Andrew Morgan2-1/+3
as 3.1.0 removed the deprecated jinja2.Markup class which we still rely on.
2022-03-24Revert "Replace instances of deprecated `Jinja2.Markup` with ↵Andrew Morgan2-6/+4
`markupsafe.Markup`" (#12296) This reverts commit 8810c93e828a9ed1dcb008d08be8aa9fcb4d28c3.
2022-03-24update changelog for 1.55.1 v1.55.1Andrew Morgan1-2/+2
2022-03-241.55.1Andrew Morgan4-2/+18
2022-03-24Replace instances of deprecated `Jinja2.Markup` with `markupsafe.Markup` ↵Andrew Morgan3-4/+7
(#12289) Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-03-24Do not consider events by ignored users for relations (#12285)Patrick Cloke7-4/+90
Filter the events returned from `/relations` for the requester's ignored users in a similar way to `/messages` (and `/sync`).
2022-03-24Optionally include account validity in MSC3720 account status responses (#12266)Brendan Abolivier4-1/+73
2022-03-23Refuse to start if DB has an unsafe locale (#12262)Shay6-18/+93
2022-03-23Use psycopg2 type stubs (#12269)David Robertson4-4/+14
2022-03-23Remove mutual_rooms `update_user_directory` check, and add extra ↵Jonathan de Jong3-5/+17
documentation (#12038) Resolves #10339
2022-03-23Allow registering admin users using the module API (#12250)Nicolas Werner3-0/+15
Signed-off-by: Nicolas Werner <n.werner@famedly.com>
2022-03-23Rename shared_rooms to mutual_rooms (#12036)Jonathan de Jong5-25/+27
Co-authored-by: reivilibre <olivier@librepush.net>
2022-03-22Changelog: sso -> Single Sign-On v1.55.0Andrew Morgan1-1/+1
2022-03-22changelog: move notice from rc to final releaseAndrew Morgan1-4/+5
2022-03-221.55.0Andrew Morgan5-3/+16
2022-03-22Tweak copy for sso account details template (#12265)Michael Telatynski4-6/+7
* Tweak copy for sso account details template * Update sso footer copyright year * Add newsfragment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-21Call out synctl changeDavid Robertson1-1/+3
2022-03-21Add type hints to tests files. (#12256)Dirk Klimpel6-88/+101
2022-03-21Reword 'Choose your user name' as 'Choose your account name' in the SSO ↵reivilibre2-1/+2
registration template, in order to comply with SIWA guidelines. (#12260) * Reword as 'Choose your account name' * Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-03-21Make it possible to enable compression for the metrics HTTP resource (#12258)Nick Mills-Barrett2-1/+5
* Make it possible to enable compression for the metrics HTTP resource This can provide significant bandwidth savings pulling metrics from synapse instances. * Add changelog file. * Fix type hint
2022-03-21Return a 404 from `/state` for an outlier (#12087)Richard van der Hoff3-44/+25
* Replace `get_state_for_pdu` with `get_state_ids_for_pdu` and `get_events_as_list`. * Return a 404 from `/state` and `/state_ids` for an outlier
2022-03-18Try to detect borked package installations. (#12244)David Robertson3-2/+38
* Try to detect borked package installations. Fixes #12223. Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2022-03-18Move get_bundled_aggregations to relations handler. (#12237)Patrick Cloke9-157/+173
The get_bundled_aggregations code is fairly high-level and uses a lot of store methods, we move it into the handler as that seems like a better fit.
2022-03-18Only fetch thread participation for events with threads. (#12228)Patrick Cloke4-245/+289
We fetch the thread summary in two phases: 1. The summary that is shared by all users (count of messages and latest event). 2. Whether the requesting user has participated in the thread. There's no use in attempting step 2 for events which did not return a summary from step 1.
2022-03-18Sync more worker regexes in the documentation. (#12243)Patrick Cloke2-16/+15
2022-03-18Add some type hints to datastore (#12248)Dirk Klimpel4-84/+117
* inherit `MonthlyActiveUsersStore` from `RegistrationWorkerStore` Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-03-18Correct `check_username_for_spam` annotations and docs (#12246)David Robertson8-16/+46
* Formally type the UserProfile in user searches * export UserProfile in synapse.module_api * Update docs Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2022-03-17Generate announcement links in release script (#12242)David Robertson2-1/+41
2022-03-17Add type hints to more tests files. (#12240)Dirk Klimpel6-47/+66
2022-03-16Re-generate changelog. v1.55.0rc1Patrick Cloke2-1/+1
2022-03-16Fix bundling aggregations if unsigned is not a returned event field. (#12234)Patrick Cloke3-3/+35
An error occured if a filter was supplied with `event_fields` which did not include `unsigned`. In that case, bundled aggregations are still added as the spec states it is allowed for servers to add additional fields.
2022-03-16Handle cancellation in `DatabasePool.runInteraction()` (#12199)Sean Quah3-24/+96
To handle cancellation, we ensure that `after_callback`s and `exception_callback`s are always run, since the transaction will complete on another thread regardless of cancellation. We also wait until everything is done before releasing the `CancelledError`, so that logging contexts won't get used after they have been finished. Signed-off-by: Sean Quah <seanq@element.io>
2022-03-16Add a relations handler to avoid duplication. (#12227)Patrick Cloke5-69/+134
Adds a handler layer between the REST and datastore layers for relations.
2022-03-16Add some missing type hints to cache datastore. (#12216)Patrick Cloke2-21/+37
2022-03-16Fix dead link in spam checker warning (#12231)David Robertson2-2/+3
2022-03-16Refactor relations tests (#12232)Patrick Cloke2-406/+364
* Moves the relation pagination tests to a separate class. * Move the assertion of the response code into the `_send_relation` helper. * Moves some helpers into the base-class.
2022-03-16Clean-up logic for rebasing URLs during URL preview. (#12219)Patrick Cloke4-91/+26
By using urljoin from the standard library and reducing the number of places URLs are rebased.
2022-03-15Use the ignored_users table to test event visibility & sync. (#12225)Patrick Cloke6-47/+62
Instead of fetching the raw account data and re-parsing it. The ignored_users table is a denormalised version of the account data for quick searching.
2022-03-15Add tests for database transaction callbacks (#12198)Sean Quah2-1/+104
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-15Add type hints to some tests/handlers files. (#12224)Dirk Klimpel7-131/+156
2022-03-15Changelog tweaksDavid Robertson1-4/+6
2022-03-151.55.0rc1David Robertson65-63/+89
2022-03-14Add cancellation support to `@cached` and `@cachedList` decorators (#12183)Sean Quah3-2/+157
These decorators mostly support cancellation already. Add cancellation tests and fix use of finished logging contexts by delaying cancellation, as suggested by @erikjohnston. Signed-off-by: Sean Quah <seanq@element.io>
2022-03-14Add cancellation support to `ReadWriteLock` (#12120)Sean Quah4-93/+382
Also convert `ReadWriteLock` to use async context managers. Signed-off-by: Sean Quah <seanq@element.io>
2022-03-14Fix broken background updates when using sqlite with `enable_search` off ↵Sean Quah2-6/+8
(#12215) Signed-off-by: Sean Quah <seanq@element.io>
2022-03-14Add `delay_cancellation` utility function (#12180)Sean Quah3-12/+161
`delay_cancellation` behaves like `stop_cancellation`, except it delays `CancelledError`s until the original `Deferred` resolves. This is handy for unifying cleanup paths and ensuring that uncancelled coroutines don't use finished logcontexts. Signed-off-by: Sean Quah <seanq@element.io>
2022-03-12Deprecate the groups/communities endpoints and add an experimental ↵Patrick Cloke7-7/+35
configuration flag. (#12200)
2022-03-11Add config settings for background update parameters (#11980)Shay9-34/+430
2022-03-11Implement a Jinja2 filter to extract localparts from email addresses (#12212)Brendan Abolivier6-2/+23
2022-03-11Improve code documentation for the typing stream over replication. (#12211)reivilibre5-6/+20
2022-03-11Add an additional HTTP pusher + push rule tests. (#12188)Nick Mills-Barrett5-28/+95
And rename the field used for caching from _id to _cache_key.
2022-03-11Update the SSO username picker template to comply with SIWA guidelines (#12210)Brendan Abolivier8-13/+47
Fixes https://github.com/matrix-org/synapse/issues/12205
2022-03-11Add type hints to `tests/rest`. (#12208)Dirk Klimpel5-85/+129
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-03-11Add some type hints to the tests.handlers module. (#12207)Patrick Cloke7-61/+74
2022-03-11Remove unnecessary pass statements. (#12206)Patrick Cloke11-15/+1
2022-03-11Note that contributors can sign off privately (#12204)Andrew Morgan2-0/+12
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2022-03-11Retention test: avoid relying on state at purged events (#12202)Richard van der Hoff2-12/+18
This test was relying on poking events which weren't in the database into filter_events_for_client.
2022-03-10Document that most streams can only have a single writer. (#12196)~creme2-14/+18
This includes the `typing`, `to_device`, `account_data`, `receipts`, and `presence` streams (really anything except the `events` stream).
2022-03-10fix misleading comment in `check_events_for_spam` (#12203)Shay2-2/+3
2022-03-10Remove workaround introduced in Synapse v1.50.0rc1 for Mjolnir ↵reivilibre3-7/+9
compatibility. Breaks compatibility with Mjolnir v1.3.1 and earlier. (#11700)
2022-03-10Support stable identifiers for MSC3440: Threading (#12151)Patrick Cloke13-81/+109
The unstable identifiers are still supported if the experimental configuration flag is enabled. The unstable identifiers will be removed in a future release.
2022-03-10Updates to the Room DAG concepts development document (#12179)Richard van der Hoff2-18/+54
Some stuff that came up while we were talking about #12173.
2022-03-10Allow retrieving the relations of a redacted event. (#12130)Patrick Cloke8-83/+122
This is allowed per MSC2675, although the original implementation did not allow for it and would return an empty chunk / not bundle aggregations. The main thing to improve is that the various caches get cleared properly when an event is redacted, and that edits must not leak if the original event is redacted (as that would presumably leak something similar to the original event content).
2022-03-10Rename get_tcp_replication to get_replication_command_handler. (#12192)Patrick Cloke15-19/+20
Since the object it returns is a ReplicationCommandHandler. This is clean-up from adding support to Redis where the command handler was added as an additional layer of abstraction from the TCP protocol.
2022-03-09Remove dead code in `tests/storage/test_database.py` (#12197)Sean Quah2-16/+1
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-09Add third_party module callbacks to check if a user can delete a room and ↵Will Hunt8-1/+254
deactivate a user (#12028) * Add check_can_deactivate_user * Add check_can_shutdown_rooms * Documentation * callbacks, not functions * Various suggested tweaks * Add tests for test_check_can_shutdown_room and test_check_can_deactivate_user * Update check_can_deactivate_user to not take a Requester * Fix check_can_shutdown_room docs * Renegade and use `by_admin` instead of `admin_user_id` * fix lint * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2022-03-09Allow for ignoring some arguments when caching. (#12189)Patrick Cloke4-21/+142
* `@cached` can now take an `uncached_args` which is an iterable of names to not use in the cache key. * Requires `@cached`, @cachedList` and `@lru_cache` to use keyword arguments for clarity. * Asserts that keyword-only arguments in cached functions are not accepted. (I tested this briefly and I don't believe this works properly.)
2022-03-09Remove some unused variables/parameters. (#12187)Patrick Cloke2-9/+6
2022-03-09Retry some http replication failures (#12182)Nick Mills-Barrett2-11/+37
This allows for the target process to be down for around a minute which provides time for restarts during synapse upgrades/config updates. Closes: #12178 Signed off by Nick Mills-Barrett nick@beeper.com
2022-03-09Skip attempt to get state at backwards-extremities (#12173)Richard van der Hoff2-57/+4
We don't *have* the state at a backwards-extremity, so this is never going to do anything useful.
2022-03-08Clean-up demo scripts & documentation (#12143)Patrick Cloke9-71/+89
* Rewrites the demo documentation to be clearer, accurate, and moves it to our documentation tree. * Improvements to the demo scripts: * `clean.sh` now runs `stop.sh` first to avoid zombie processes. * Uses more modern Synapse configuration (and removes some obsolete configuration). * Consistently use the HTTP ports for server name, etc. * Remove the `demo/etc` directory and place everything into the `demo/808x` directories.
2022-03-08Use `ParamSpec` in type hints for `synapse.logging.context` (#12150)Sean Quah5-25/+37
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-08Fix CI not attaching source distributions and wheels to the GitHub releases. ↵reivilibre2-1/+3
(#12131)
2022-03-08Fix silly markdown typo v1.54.0Olivier Wilkinson (reivilibre)1-1/+1
2022-03-08Tweak changelog formattingOlivier Wilkinson (reivilibre)1-3/+2
2022-03-08Add experimental environment variable to enable asyncio reactor (#12135)Erik Johnston3-0/+25
2022-03-08Do not return allowed_room_ids from /hierarchy response. (#12175)Patrick Cloke3-2/+17
This field is only to be used in the Server-Server API, and not the Client-Server API, but was being leaked when a federation response was used in the /hierarchy API.
2022-03-08Fix incorrect type hints for txredis. (#12042)Patrick Cloke5-10/+14
Some properties were marked as RedisProtocol instead of ConnectionHandler, which wraps RedisProtocol instance(s).
2022-03-08Shift up warning about MjolnirOlivier Wilkinson (reivilibre)1-3/+4
2022-03-081.54.0Olivier Wilkinson (reivilibre)8-6/+25
2022-03-08Fix a bug introduced in 1.54.0rc1 which meant that Synapse would refuse to ↵reivilibre3-1/+22
start if pre-release versions of dependencies were installed. (#12177) * Add failing test to characterise the regression #12176 * Permit pre-release versions of specified packages * Newsfile (bugfix) Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-03-07Fix a bug in background updates wherein background updates are never run ↵Shay4-15/+16
using the default batch size (#12157)
2022-03-07Invalidate caches when an event with a relation is redacted. (#12121)Patrick Cloke6-48/+202
The caches for the target of the relation must be cleared so that the bundled aggregations are re-calculated after the redaction is processed.
2022-03-07Switch the `tests-done` job to an Action (#12161)Richard van der Hoff2-21/+10
I've factored it out for easier use in other workflows.
2022-03-04Relax version guard for packaging (#12166)David Robertson2-2/+3
It’s just occurred to me that #12088 pulled in the “packaging” package (~=21.3). I pulled in the newest version I had at the time. I only use it for packaging.requirements.Requirements. Which was added in packaging 16.1: https://github.com/pypa/packaging/releases/tag/16.1 https://pkgs.org/download/python3-packaging suggests that the oldest version we care about is 17.1 in Ubuntu Bionic. So I think with this bound we're hunky dory.
2022-03-04Reduce to-device queries for /sync. (#12163)Erik Johnston2-0/+4
2022-03-04Add type hints for `ObservableDeferred` attributes (#12159)Sean Quah2-3/+12
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-04Add test for `ObservableDeferred`'s cancellation behaviour (#12149)Sean Quah2-0/+29
Signed-off-by: Sean Quah <seanq@element.io>
2022-03-04Remove backwards compatibility with RelationPaginationToken. (#12138)Patrick Cloke4-144/+16
2022-03-04Changelog (#12153)David Robertson3-1/+2
2022-03-04Move synctl into `synapse._scripts` and expose as an entrypoint (#12140)David Robertson11-13/+33
2022-03-04Spread out sending device lists to remote hosts (#12132)Erik Johnston7-16/+79
2022-03-04Update client-visibility filtering for outlier events (#12155)Richard van der Hoff3-4/+90
Avoid trying to get the state for outliers, which isn't a sensible thing to do.
2022-03-04Fix type of `events` in `StateGroupStorage` and `StateHandler` (#12156)Richard van der Hoff3-7/+8
We make multiple passes over this, so a regular iterable won't do.
2022-03-03Avoid generating state groups for local out-of-band leaves (#12154)Richard van der Hoff2-1/+2
If we locally generate a rejection for an invite received over federation, it is stored as an outlier (because we probably don't have the state for the room). However, currently we still generate a state group for it (even though the state in that state group will be nonsense). By setting the `outlier` param on `create_event`, we avoid the nonsensical state.
2022-03-03Rename various ApplicationServices interested methods (#11915)Andrew Morgan8-76/+175
2022-03-03Detox, part 2 of N (#12152)David Robertson2-26/+1
I've argued in #11537 that poetry and tox don't cooperate well at the moment. (See also #12119.) Therefore I'm pruning away bits of tox to make the transition to poetry easier. This change removes the commands for coverage. We don't use coverage in anger at the moment. It shouldn't be too hard to add coverage as a dev-dependency and reintroduce this if we really want it.
2022-03-03Add type hints to `tests/rest` (#12146)Dirk Klimpel9-92/+104
* Add type hints to `tests/rest` * newsfile * change import from `SigningKey`
2022-03-03Use the proper serialization format when bundling aggregations. (#12090)Patrick Cloke10-143/+130
This ensures that the `latest_event` field of the bundled aggregation for threads uses the same format as the other events in the response.
2022-03-03Don't impose version checks on dev extras at runtime (#12129)David Robertson3-9/+74
* Fix incorrect argument in test case * Add copyright header * Docstring and __all__ * Exclude dev depenencies * Use changelog from #12088 * Include version in error messages This will hopefully distinguish between the version of the source code and the version of the distribution package that is installed. * Linter script is your friend
2022-03-03Enable MSC2716 Complement tests in Synapse (#12145)Eric Eastwood3-2/+3
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
2022-03-03Limit the size of the aggregation_key (#12101)Erik Johnston2-0/+4
There's no reason to let people use long keys.
2022-03-03Enable MSC3030 Complement tests in Synapse (#12144)Eric Eastwood3-2/+3
The Complement tests for MSC3030 are now merged, https://github.com/matrix-org/complement/pull/178 Synapse implmentation: https://github.com/matrix-org/synapse/pull/9445
2022-03-03Correctly register deactivation and profile update module callbacks (#12141)Brendan Abolivier3-3/+16
2022-03-02Move the `snapcraft` configuration to `contrib`. (#12142)David Robertson3-1/+1
* Move the `snapcraft` configuration to `contrib`. We're happy for people to package this as a snap image if it's useful, but we don't support or maintain it. I'd like to move the config to `contrib` to reflect this state of affairs. * Changelog
2022-03-02Add suffices to scripts in scripts-dev (#12137)David Robertson11-12/+19
* Rename scripts-dev to have suffices * Update references to `scripts-dev` * Changelog * These scripts don't pass mypy
2022-03-02