summary refs log tree commit diff
path: root/synapse/__init__.py (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-08-28Convert additional database code to async/await. (#8195)Patrick Cloke11-175/+246
2020-08-28Define StateMap as immutable and add a MutableStateMap type. (#8183)Patrick Cloke8-32/+52
2020-08-28Move and refactor LoginRestServlet helper methods (#8182)Andrew Morgan3-55/+94
This is split out from https://github.com/matrix-org/synapse/pull/7438, which had gotten rather large. `LoginRestServlet` has a couple helper methods, `login_submission_legacy_convert` and `login_id_thirdparty_from_phone`. They're primarily used for converting legacy user login submissions to "identifier" dicts ([see spec](https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-login)). Identifying information such as usernames or 3PID information used to be top-level in the login body. They're now supposed to be put inside an [identifier](https://matrix.org/docs/spec/client_server/r0.6.1#identifier-types) parameter instead. #7438's purpose is to allow using the new identifier parameter during User-Interactive Authentication, which is currently handled in AuthHandler. That's why I've moved these helper methods there. I also moved the refactoring of these method from #7438 as they're relevant.
2020-08-27Do not yield on awaitables in tests. (#8193)Patrick Cloke15-131/+230
2020-08-27Convert stats and related calls to async/await (#8192)Patrick Cloke8-77/+78
2020-08-27Convert simple_delete to async/await. (#8191)Patrick Cloke5-37/+90
2020-08-27Convert calls of async database methods to async (#8166)Patrick Cloke14-84/+114
2020-08-27simple_search_list_txn should return None, not 0. (#8187)Patrick Cloke2-4/+4
2020-08-27Fix missing _add_persisted_position (#8179)Erik Johnston3-3/+52
This was forgotten in #8164.
2020-08-27Convert additional database methods to async (select list, search, ↵Patrick Cloke8-84/+67
insert_many, delete_*) (#8168)
2020-08-27Convert simple_update* and simple_select* to async (#8173)Patrick Cloke19-133/+164
2020-08-27Reduce run-times of tests by advancing the reactor less (#7757)Andrew Morgan7-8/+9
2020-08-271.19.1 v1.19.1 release-v1.19.1Brendan Abolivier3-1/+13
2020-08-27Update debian systemd service to use Type=notify (#8169)Dexter Chua2-1/+7
This ensures systemctl start matrix-synapse returns only after synapse is actually started, which is very useful for automated deployments. Fixes #5761 Signed-off-by: Dexter Chua <dec41@srcf.net>
2020-08-26Remove remaining is_guest argument uses from get_room_data calls (#8181)Andrew Morgan2-10/+3
#8174 removed the `is_guest` parameter from `get_room_data`, at the same time that #8157 was merged using it, colliding together to break unit tests on develop. This PR removes the `is_guest` parameter from the call in the broken test. Uses the same changelog as #8174.
2020-08-26Do not propagate typing notifications from shadow-banned users. (#8176)Patrick Cloke6-24/+102
2020-08-26Remove unused parameter from, and add safeguard in, get_room_data (#8174)Andrew Morgan4-10/+14
Small cleanup PR. * Removed the unused `is_guest` argument * Added a safeguard to a (currently) impossible code path, fixing static checking at the same time.
2020-08-26Add required Debian dependencies to allow docker builds on the arm platform ↵Christopher May-Townsend2-3/+11
(#8144) Signed-off-by: Christopher May-Townsend <chris@maytownsend.co.uk>
2020-08-26Allow running mypy directly. (#8175)Patrick Cloke3-51/+51
2020-08-26Update the test federation client to handle streaming responses (#8130)Richard van der Hoff2-8/+28
Now that the server supports streaming back JSON responses, it would be nice to show the response as it is streamed, in the test tool.
2020-08-26Do not propagate profile changes of shadow-banned users into rooms. (#8157)Patrick Cloke5-160/+291
2020-08-26Make SlavedIdTracker.advance have same interface as MultiWriterIDGenerator ↵Erik Johnston12-15/+16
(#8171)
2020-08-26Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke25-113/+220
2020-08-26Fix rate limiting unit tests. (#8167)Patrick Cloke2-13/+15
These were passing on the release-v1.19.1 branch but started failing once merged to develop.
2020-08-25Add functions to `MultiWriterIdGen` used by events stream (#8164)Erik Johnston4-3/+145
2020-08-25Do not allow send_nonmember_event to be called with shadow-banned users. (#8158)Patrick Cloke2-5/+35
2020-08-25Changelog fixes v1.19.1rc1Brendan Abolivier1-1/+1
2020-08-251.19.1rc1Brendan Abolivier4-3/+11
2020-08-25Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston14-49/+54
This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
2020-08-25Wording fixes to 'name' user admin api filter (#8163)Andrew Morgan4-5/+7
Some fixes to wording I noticed after merging #7377.
2020-08-25Fix missing double-backtick in RST documentAndrew Morgan1-1/+1
2020-08-25Search in columns 'name' and 'displayname' in the admin users endpoint (#7377)Manuel Stahl4-15/+27
* Search in columns 'name' and 'displayname' in the admin users endpoint Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
2020-08-24Add type hints for state. (#8140)Patrick Cloke10-203/+420
2020-08-24Stop shadow-banned users from sending non-member events. (#8142)Patrick Cloke8-42/+155
2020-08-24Allow capping a room's retention policy (#8104)Brendan Abolivier6-107/+127
2020-08-24Add healthcheck for default localhost 8008 port on /health endpoint. (#8147)Christopher May-Townsend3-0/+34
2020-08-24Fix flaky shadow-ban tests. (#8152)Patrick Cloke2-1/+4
2020-08-24Fix join ratelimiter breaking profile updates and idempotency (#8153)Brendan Abolivier4-25/+119
2020-08-24Do not apply ratelimiting on joins to appservices (#8139)Will Hunt4-6/+119
Add new method ratelimiter.can_requester_do_action and ensure that appservices are exempt from being ratelimited. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Erik Johnston <erik@matrix.org>
2020-08-24Don't fail /submit_token requests on incorrect session ID if ↵Brendan Abolivier5-6/+68
request_token_inhibit_3pid_errors is turned on (#7991) * Don't raise session_id errors on submit_token if request_token_inhibit_3pid_errors is set * Changelog * Also wait some time before responding to /requestToken * Incorporate review * Update synapse/storage/databases/main/registration.py Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Incorporate review Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-08-21Do not apply ratelimiting on joins to appservices (#8139)Will Hunt4-6/+119
Add new method ratelimiter.can_requester_do_action and ensure that appservices are exempt from being ratelimited. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Erik Johnston <erik@matrix.org>
2020-08-21Micro-optimisations to get_auth_chain_ids (#8132)Richard van der Hoff2-23/+18
2020-08-20Allow denying or shadow banning registrations via the spam checker (#8034)Patrick Cloke14-18/+258
2020-08-20Stop shadow-banned users from sending invites. (#8095)Patrick Cloke7-31/+226
2020-08-20Be more tolerant of membership events in unknown rooms (#8110)Richard van der Hoff3-6/+28
It turns out that not all out-of-band membership events are labelled as such, so we need to be more accepting here.
2020-08-20Improve the error code when trying to register using a name reserved for ↵Patrick Cloke2-1/+4
guests. (#8135)
2020-08-20Use the JSON encoder without whitespace in more places. (#8124)Patrick Cloke9-27/+21
2020-08-20Add more types to synapse.storage.database. (#8127)Patrick Cloke3-222/+367
2020-08-20Ensure a group ID is valid before trying to get rooms for it. (#8129)Patrick Cloke2-0/+5
2020-08-20Do not assume calls to runInteraction return Deferreds. (#8133)Patrick Cloke7-31/+41
2020-08-19Close the database connection we create during startup (#8131)Richard van der Hoff2-1/+11
... otherwise it gets leaked.
2020-08-19Remove `ChainedIdGenerator`. (#8123)Erik Johnston7-95/+26
It's just a thin wrapper around two ID gens to make `get_current_token` and `get_next` return tuples. This can easily be replaced by calling the appropriate methods on the underlying ID gens directly.
2020-08-19Switch the JSON byte producer from a pull to a push producer. (#8116)Patrick Cloke5-46/+53
2020-08-19Updated docs: Added note about missing 308 redirect support. (#8120)Ryan Cole2-0/+13
* Updated docs: Added note about missing 308 redirect support. * Added changelog
2020-08-19Be stricter about JSON that is accepted by Synapse (#8106)Patrick Cloke20-62/+85
2020-08-19Convert runWithConnection to async. (#8121)Patrick Cloke3-15/+15
2020-08-19Remove the unused inlineCallbacks code-paths in the caching code (#8119)Patrick Cloke3-52/+15
2020-08-19Separate `get_current_token` into two. (#8113)Erik Johnston6-20/+47
The function is used for two purposes: 1) for subscribers of streams to get a token they can use to get further updates with, and 2) for replication to track position of the writers of the stream. For streams with a single writer the two scenarios produce the same result, however the situation becomes complicated for streams with multiple writers. The current `MultiWriterIdGenerator` does not correctly handle the first case (which is not an issue as its only used for the `caches` stream which nothing subscribes to outside of replication).
2020-08-18Convert events worker database to async/await. (#8071)Patrick Cloke12-97/+106
2020-08-18Add a link to the matrix-synapse-rest-password-provider. (#8111)Patrick Cloke2-0/+2
2020-08-18Fix the return type of send_nonmember_events. (#8112)Patrick Cloke3-5/+17
2020-08-18Remove : from allowed client_secret chars (#8101)Andrew Morgan4-6/+16
Closes: https://github.com/matrix-org/synapse/issues/6766 Equivalent Sydent PR: https://github.com/matrix-org/sydent/pull/309 I believe it's now time to remove the extra allowed `:` from `client_secret` parameters.
2020-08-18Rename changelog from bugfix to misc.Patrick Cloke1-0/+0
2020-08-18Iteratively encode JSON responses to avoid blocking the reactor. (#8013)Patrick Cloke5-13/+94
2020-08-18Return the previous stream token if a non-member event is a duplicate. (#8093)Patrick Cloke2-10/+16
2020-08-18Add resources.consent conditional dependency back (#8107)Andrew Morgan2-20/+1
Turns out that part of the codebase (synapse.config.server) checks for this key explicitly. Remove that check.
2020-08-17Convert some of the general database methods to async (#8100)Patrick Cloke13-59/+69
2020-08-17Use the default templates when a custom template file cannot be found (#8037)Andrew Morgan15-290/+310
Fixes https://github.com/matrix-org/synapse/issues/6583
2020-08-17Changelog changes v1.19.0 release-v1.19.0Olivier Wilkinson (reivilibre)1-5/+4
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2020-08-171.19.0Olivier Wilkinson (reivilibre)3-4/+10
2020-08-17Convert stream database to async/await. (#8074)Patrick Cloke11-227/+224
2020-08-14Add a shadow-banned flag to users. (#8092)Patrick Cloke12-12/+83
2020-08-14Convert pusher databases to async/await. (#8075)Patrick Cloke4-95/+90
2020-08-14Convert receipts and events databases to async/await. (#8076)Patrick Cloke4-82/+80
2020-08-14Add type hints to synapse.handlers.room (#8090)Erik Johnston3-39/+69
2020-08-14Remove some unused database functions. (#8085)Patrick Cloke7-244/+19
2020-08-14Convert misc database code to async (#8087)Patrick Cloke11-64/+39
2020-08-13Remove a space at the start of a changelog entry.Patrick Cloke1-1/+1
2020-08-13More changelog tweaks v1.19.0rc1Olivier Wilkinson (reivilibre)1-4/+4
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2020-08-13More changelog tweaksOlivier Wilkinson (reivilibre)1-4/+8
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2020-08-13Remove unwanted changelog lineOlivier Wilkinson (reivilibre)1-1/+0
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2020-08-131.19.0rc1Olivier Wilkinson (reivilibre)72-71/+67
2020-08-13Run `remove_push_actions_from_staging` in foreground (#8081)Richard van der Hoff2-3/+2
If we got an error persisting an event, we would try to remove the push actions asynchronously, which would lead to a 'Re-starting finished log context' warning. I don't think there's any need for this to be asynchronous.
2020-08-13Drop federation transmission queues during a significant remote outage. (#7864)reivilibre2-0/+23
* Empty federation transmission queues when we are backing off. Fixes #7828. Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Address feedback Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> * Reword newsfile
2020-08-13Fix unawaited coroutine error in tests. (#8072)Patrick Cloke2-10/+21
2020-08-12Convert the roommember database to async/await. (#8070)Patrick Cloke5-242/+116
2020-08-12Convert devices database to async/await. (#8069)Patrick Cloke5-176/+220
2020-08-12Add type hints to handlers.message and events.builder (#8067)Erik Johnston7-41/+61
2020-08-12Convert account data, device inbox, and censor events databases to ↵Patrick Cloke5-87/+99
async/await (#8063)
2020-08-12Convert appservice, group server, profile and more databases to async (#8066)Patrick Cloke9-116/+91
2020-08-12Fix typing for notifier (#8064)Erik Johnston6-16/+38
2020-08-11Convert tags and metrics databases to async/await (#8062)Patrick Cloke4-65/+64
2020-08-11Converts event_federation and registration databases to async/await (#8061)Patrick Cloke7-177/+150
2020-08-11Add comment explaining castErik Johnston1-0/+2
2020-08-11