summary refs log tree commit diff
path: root/synapse/server.pyi (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change HomeServer definition to work with typing.Erik Johnston2020-08-111-155/+0
| | | | | | | | | | Duplicating function signatures between server.py and server.pyi is silly. This commit changes that by changing all `build_*` methods to `get_*` methods and changing the `_make_dependency_method` to work work as a descriptor that caches the produced value. There are some changes in other files that were made to fix the typing in server.py.
* Fix typing replication not being handled on master (#7959)Erik Johnston2020-07-271-0/+3
| | | | | | | | | | | | | | | | Handling of incoming typing stream updates from replication was not hooked up on master, effecting set ups where typing was handled on a different worker. This is really only a problem if the master process is also handling sync requests, which is unlikely for those that are at the stage of moving typing off. The other observable effect is that if a worker restarts or a replication connect drops then the typing worker will issue a `POSITION typing`, triggering master process to try and stream *all* typing updates from position 0. Fixes #7907
* Allow moving typing off master (#7869)Erik Johnston2020-07-161-0/+2
|
* Fix client reader sharding tests (#7853)Erik Johnston2020-07-151-0/+5
| | | | | | | | | | | | | | | * Fix client reader sharding tests * Newsfile * Fix typing * Update changelog.d/7853.misc Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Move mocking of http_client to tests Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-0/+2
| | | | | | | | | | | | | | | | | | The Delete Room admin API allows server admins to remove rooms from server and block these rooms. `DELETE /_synapse/admin/v1/rooms/<room_id>` It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API. Fixes: #6425 It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`. It should return `None` if the room is unknown. But it returns an `IndexError`. https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105 Related to: - #5575 - https://github.com/Awesome-Technologies/synapse-admin/issues/17 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add ability to wait for replication streams (#7542)Erik Johnston2020-05-221-0/+5
| | | | | | | The idea here is that if an instance persists an event via the replication HTTP API it can return before we receive that event over replication, which can lead to races where code assumes that persisting an event immediately updates various caches (e.g. current state of the room). Most of Synapse doesn't hit such races, so we don't do the waiting automagically, instead we do so where necessary to avoid unnecessary delays. We may decide to change our minds here if it turns out there are a lot of subtle races going on. People probably want to look at this commit by commit.
* Move EventStream handling into default ReplicationDataHandler (#7493)Erik Johnston2020-05-141-0/+3
| | | This is so that the logic can happen on both master and workers when we move event persistence out.
* Implement OpenID Connect-based login (#7256)Quentin Gliech2020-05-081-0/+5
|
* Add instance name to RDATA/POSITION commands (#7364)Erik Johnston2020-04-291-0/+2
| | | | | This is primarily for allowing us to send those commands from workers, but for now simply allows us to ignore echoed RDATA/POSITION commands that we sent (we get echoes of sent commands when using redis). Currently we log a WARNING on the master process every time we receive an echoed RDATA.
* Fix limit logic for EventsStream (#7358)Richard van der Hoff2020-04-291-0/+5
| | | | | | | | | | | | | | | | | | | * Factor out functions for injecting events into database I want to add some more flexibility to the tools for injecting events into the database, and I don't want to clutter up HomeserverTestCase with them, so let's factor them out to a new file. * Rework TestReplicationDataHandler This wasn't very easy to work with: the mock wrapping was largely superfluous, and it's useful to be able to inspect the received rows, and clear out the received list. * Fix AssertionErrors being thrown by EventsStream Part of the problem was that there was an off-by-one error in the assertion, but also the limit logic was too simple. Fix it all up and add some tests.
* Stop the master relaying USER_SYNC for other workers (#7318)Richard van der Hoff2020-04-221-1/+1
| | | | | | | Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication. In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits. Fixes (I hope) #7257.
* Move client command handling out of TCP protocol (#7185)Erik Johnston2020-04-061-1/+6
| | | The aim here is to move the command handling out of the TCP protocol classes and to also merge the client and server command handling (so that we can reuse them for redis protocol). This PR simply moves the client paths to the new `ReplicationCommandHandler`, a future PR will move the server paths too.
* Remove usage of "conn_id" for presence. (#7128)Erik Johnston2020-03-301-0/+2
| | | | | | | | | | | | | | | | * Remove `conn_id` usage for UserSyncCommand. Each tcp replication connection is assigned a "conn_id", which is used to give an ID to a remotely connected worker. In a redis world, there will no longer be a one to one mapping between connection and instance, so instead we need to replace such usages with an ID generated by the remote instances and included in the replicaiton commands. This really only effects UserSyncCommand. * Add CLEAR_USER_SYNCS command that is sent on shutdown. This should help with the case where a synchrotron gets restarted gracefully, rather than rely on 5 minute timeout.
* Port PresenceHandler to async/await (#6991)Erik Johnston2020-02-261-0/+5
|
* Add typing to synapse.federation.sender (#6871)Erik Johnston2020-02-071-0/+2
|
* Fix sending server up commands from workers (#6811)Erik Johnston2020-01-301-1/+11
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Wake up transaction queue when remote server comes back online (#6706)Erik Johnston2020-01-171-0/+12
| | | | | This will be used to retry outbound transactions to a remote server if we think it might have come back up.
* Support for routing outbound HTTP requests via a proxy (#6239)Richard van der Hoff2019-11-011-0/+9
| | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198.
* Update black to 19.10b0 (#6304)Amber Brown2019-11-011-8/+8
| | | * update version of black and also fix the mypy config being overridden
* Run Black. (#5482)Amber Brown2019-06-201-27/+24
|
* Fix CI after new release of isortBrendan Abolivier2019-05-131-1/+0
|
* Rename and move the classesRichard van der Hoff2019-03-131-1/+2
|
* Move from TravisCI to BuildKite (#4752)Amber Brown2019-02-271-1/+1
|
* Revert "Prevent showing non-fed rooms in fed /publicRooms"Andrew Morgan2019-02-261-1/+1
|
* Address rich commentsAndrew Morgan2019-02-261-1/+1
|
* Basic initial support for room upgradesRichard van der Hoff2018-10-251-0/+6
| | | | | Currently just creates a new, empty, room, and sends a tombstone in the old room.
* Send users a server notice about consentRichard van der Hoff2018-05-221-0/+4
| | | | | When a user first syncs, we will send them a server notice asking them to consent to the privacy policy if they have not already done so.
* Infrastructure for a server notices roomRichard van der Hoff2018-05-171-0/+12
| | | | | | | Server Notices use a special room which the user can't dismiss. They are created on demand when some other bit of the code calls send_notice. (This doesn't actually do much yet becuse we don't call send_notice anywhere)
* Move RoomCreationHandler out of synapse.handlers.HandlersRichard van der Hoff2018-05-171-0/+3
| | | | | | | Handlers is deprecated nowadays, so let's move this out before I add a new dependency on it. Also fix the docstrings on create_room.
* Factor out resolve_state_groups to a separate handlerRichard van der Hoff2018-02-011-0/+3
| | | | | | We extract the storage-independent bits of the state group resolution out to a separate functiom, and stick it in a new handler, in preparation for its use from the storage layer.
* Move set_password into its own handlerRichard van der Hoff2017-11-291-0/+4
| | | | | | Non-functional refactoring to move set_password. This means that we'll be able to properly deactivate devices and access tokens without introducing a dependency loop.
* Move deactivate_account into its own handlerRichard van der Hoff2017-11-291-1/+6
| | | | | | Non-functional refactoring to move deactivate_account. This means that we'll be able to properly deactivate devices and access tokens without introducing a dependency loop.
* Build MediaRepositoryResource as a homeserver dependencyRichard van der Hoff2017-11-221-0/+7
| | | | | | This avoids the scenario where we have four different PreviewUrlResources configured on a single app, each of which have their own caches and cache clearing jobs.
* Doc some more dynamic Homeserver methodsRichard van der Hoff2017-10-171-0/+8
|
* Fix login with m.login.tokenRichard van der Hoff2016-08-081-0/+4
| | | | | login with token (as used by CAS auth) was broken by 067596d, such that it always returned a 401.
* Move e2e query logic into a handlerRichard van der Hoff2016-08-011-0/+4
|
* Type annotationsRichard van der Hoff2016-07-191-0/+21
Add some type annotations to help PyCharm (in particular) to figure out the types of a bunch of things.