summary refs log tree commit diff
path: root/scripts-dev/mypy_synapse_plugin.py (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-10-28Remove frozendict_json_encoder and support frozendicts everywhereRichard van der Hoff7-38/+32
Not being able to serialise `frozendicts` is fragile, and it's annoying to have to think about which serialiser you want. There's no real downside to supporting frozendicts, so let's just have one json encoder.
2020-10-28Add type hints to application services. (#8655)Patrick Cloke5-79/+122
2020-10-28Add an admin APIs to allow server admins to list users' pushers (#8610)Dirk Klimpel5-1/+259
Add an admin API `GET /_synapse/admin/v1/users/<user_id>/pushers` like https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushers
2020-10-28Run mypy as part of the lint.sh script. (#8633)kleph3-2/+4
2020-10-28Don't pull event from DB when handling replication traffic. (#8669)Erik Johnston5-31/+87
I was trying to make it so that we didn't have to start a background task when handling RDATA, but that is a bigger job (due to all the code in `generic_worker`). However I still think not pulling the event from the DB may help reduce some DB usage due to replication, even if most workers will simply go and pull that event from the DB later anyway. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2020-10-27Tell Black to format code for Python 3.5 (#8664)Dan Callahan10-11/+12
This allows trailing commas in multi-line arg lists. Minor, but we might as well keep our formatting current with regard to our minimum supported Python version. Signed-off-by: Dan Callahan <danc@element.io>
2020-10-27Minor updates to docs on how to run tests (#8666)Dan Callahan3-10/+6
The test runner isn't present in the `[all]` set of extras, so the previous instructions did not work without also installing `[test]`. Note that this does not include the `[lint]` extras, since those do not install on all supported Python versions (specifically, isort 5.x requires Python 3.6, while we still support 3.5). Instructions for that are included in our pull request template, so we should be fine there. I've also dropped the `--no-use-pep517` arg to `pip install` since it seems to have been added to address a temporary regression in pip 19.1 which was fixed in pip 19.1.1 the following month. Lastly, updated the example output of the test suite to set more realistic expectations around run time. Signed-off-by: Dan Callahan <danc@element.io>
2020-10-27Note support for Python 3.9 (#8665)Dan Callahan4-2/+4
As expected, all tests pass locally without modification. Signed-off-by: Dan Callahan <danc@element.io>
2020-10-27Cross-link documentation to the prometheus recording rules. (#8667)Michael Kaye3-1/+4
2020-10-27Abstract code for stripping room state into a separate method (#8671)Andrew Morgan3-29/+61
This is a requirement for [knocking](https://github.com/matrix-org/synapse/pull/6739), and is abstracting some code that was originally used by the invite flow. I'm separating it out into this PR as it's a fairly contained change. For a bit of context: when you invite a user to a room, you send them [stripped state events](https://matrix.org/docs/spec/server_server/unstable#put-matrix-federation-v2-invite-roomid-eventid) as part of `invite_room_state`. This is so that their client can display useful information such as the room name and avatar. The same requirement applies to knocking, as it would be nice for clients to be able to display a list of rooms you've knocked on - room name and avatar included. The reason we're sending membership events down as well is in the case that you are invited to a room that does not have an avatar or name set. In that case, the client should use the displayname/avatar of the inviter. That information is located in the inviter's membership event. This is optional as knocks don't really have any user in the room to link up to. When you knock on a room, your knock is sent by you and inserted into the room. It wouldn't *really* make sense to show the avatar of a random user - plus it'd be a data leak. So I've opted not to send membership events to the client here. The UX on the client for when you knock on a room without a name/avatar is a separate problem. In essence this is just moving some inline code to a reusable store method.
2020-10-27Don't unnecessarily start bg process in replication sending loop. (#8670)Erik Johnston2-0/+11
2020-10-27Don't unnecessarily start bg process while handling typing. (#8668)Erik Johnston2-8/+14
There's no point starting a background process when all its going to do is bail if federation isn't enabled.
2020-10-27Add admin API to list users' local media (#8647)Dirk Klimpel8-1/+494
Add admin API `GET /_synapse/admin/v1/users/<user_id>/media` to get information of users' uploaded files.
2020-10-271.22.0 v1.22.0 github/release-v1.22.0 release-v1.22.0Erik Johnston3-1/+13
2020-10-26e2e: ensure we have both master and self-signing key (#8455)Jonas Jelten2-5/+23
it seems to be possible that only one of them ends up to be cached. when this was the case, the missing one was not fetched via federation, and clients then failed to validate cross-signed devices. Signed-off-by: Jonas Jelten <jj@sft.lol>
2020-10-26Add type hints for account validity handler (#8620)Patrick Cloke6-12/+31
This also fixes a bug by fixing handling of an account which doesn't expire.
2020-10-26Split admin API for reported events into a detail and a list view (#8539)Dirk Klimpel6-86/+411
Split admin API for reported events in detail und list view. API was introduced with #8217 in synapse v.1.21.0. It makes the list (`GET /_synapse/admin/v1/event_reports`) less complex and provides a better overview. The details can be queried with: `GET /_synapse/admin/v1/event_reports/<report_id>`. It is similar to room and users API. It is a kind of regression in `GET /_synapse/admin/v1/event_reports`. `event_json` was removed. But the api was introduced one version before and it is an admin API (not under spec). Signed-off-by: Dirk Klimpel dirk@klimpel.org
2020-10-26Added basic instructions for Azure AD to OpenId documentation (#8582)Peter Krantz2-0/+27
Signed-off-by: Peter Krantz peter.krantz@gmail.com
2020-10-26Add an admin api to delete local media. (#8519)Dirk Klimpel7-3/+868
Related to: #6459, #3479 Add `DELETE /_synapse/admin/v1/media/<server_name>/<media_id>` to delete a single file from server.
2020-10-26Fix filepath of Dex example config (#8657)Andrew Morgan2-3/+3
2020-10-26Fix a bug in the joined_rooms admin API (#8643)Dirk Klimpel3-4/+20
If the user was not in any rooms then the API returned the same error as if the user did not exist.
2020-10-26Fixup changelog v1.22.0rc2Erik Johnston1-3/+1
2020-10-26Expand changelog entryErik Johnston1-1/+1
2020-10-261.22.0rc2Erik Johnston5-4/+12
2020-10-26Fix get|set_type_stream_id_for_appservice store functions (#8648)Will Hunt4-13/+85
2020-10-26Fix get|set_type_stream_id_for_appservice store functions (#8648)Will Hunt4-13/+85
2020-10-26Add field `total` to device list in admin API (#8644)Dirk Klimpel4-2/+23
2020-10-26Check status codes that profile handler returns (#8580)LEdoian2-0/+8
Fixes #8520 Signed-off-by: Pavel Turinsky <pavel.turinsky@matfyz.cz> Co-authored-by: Erik Johnston <erikj@jki.re>
2020-10-26Properly handle presence events for application services. (#8656)Patrick Cloke2-4/+6
2020-10-26Fix user_daily_visits to not have duplicate rows for UA. (#8654)Erik Johnston2-4/+6
* Fix user_daily_visits to not have duplicate rows for UA. Fixes #8641. * Newsfile * Fix typo. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2020-10-26Start fewer opentracing spans (#8640)Erik Johnston8-53/+96
#8567 started a span for every background process. This is good as it means all Synapse code that gets run should be in a span (unless in the sentinel logging context), but it means we generate about 15x the number of spans as we did previously. This PR attempts to reduce that number by a) not starting one for send commands to Redis, and b) deferring starting background processes until after we're sure they're necessary. I don't really know how much this will help.