summary refs log tree commit diff
path: root/tests/events/test_presence_router.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Removed `request_key` from the `SyncConfig` (moved outside as its own ↵Eric Eastwood2024-05-161-2/+15
| | | | | | | | | function parameter) (#17201) Removed `request_key` from the `SyncConfig` (moved outside as its own function parameter) so it doesn't have to flow into `_generate_sync_entry_for_xxx` methods. This way we can separate the concerns of caching from generating the response and reuse the `_generate_sync_entry_for_xxx` functions as we see fit. Plus caching doesn't really have anything to do with the config of sync. Split from https://github.com/element-hq/synapse/pull/17167 Spawning from https://github.com/element-hq/synapse/pull/17167#discussion_r1601497279
* Refactor Sync handler to be able to return different sync responses ↵Eric Eastwood2024-05-161-2/+2
| | | | | | | | | | | | | | (`SyncVersion`) (#17200) Refactor Sync handler to be able to be able to return different sync responses (`SyncVersion`). Preparation to be able support sync v2 and a new Sliding Sync `/sync/e2ee` endpoint which returns a subset of sync v2. Split upon request: https://github.com/element-hq/synapse/pull/17167#discussion_r1601497279 Split from https://github.com/element-hq/synapse/pull/17167 where we will add `SyncVersion.E2EE_SYNC` and a new type of sync response.
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Replace simple_async_mock with AsyncMock (#16180)Patrick Cloke2023-08-251-3/+2
| | | | Python 3.8 has a native AsyncMock, use it instead of a custom implementation.
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-141-7/+5
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Proper types for `tests.module_api` (#15031)David Robertson2023-02-091-3/+7
| | | | | | | | | | | | | * -> None for test methods * A first batch of type fixes * Introduce common parent test case * Fixup that big test method * tests.module_api passes mypy * Changelog
* Add missing type hints for tests.events. (#14904)Patrick Cloke2023-01-251-23/+35
|
* Modernize unit tests configuration settings for workers. (#14568)realtyem2022-12-011-4/+12
| | | | Use the newer foo_instances configuration instead of the deprecated flags to enable specific features (e.g. start_pushers).
* Register homeserver modules when creating test homeserver (#13558)Andrew Morgan2022-08-191-4/+0
|
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-271-1/+1
| | | Instead of hard-coding strings in many places.
* Fix errors in Synapse logs from unit tests. (#10939)Patrick Cloke2021-09-301-1/+6
| | | | | Fix some harmless errors from background processes (mostly due to awaiting Mock objects) that occurred in the Synapse logs during unit tests.
* Port the PresenceRouter module interface to the new generic interface (#10524)Azrenbeth2021-08-171-5/+104
| | | Port the PresenceRouter module interface to the new generic interface introduced in v1.37.0
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-1/+1
|
* Stagger send presence to remotes (#10398)Erik Johnston2021-07-151-0/+8
| | | | | | This is to help with performance, where trying to connect to thousands of hosts at once can consume a lot of CPU (due to TLS etc). Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Use inline type hints in `tests/` (#10350)Jonathan de Jong2021-07-131-3/+3
| | | | | | | | This PR is tantamount to running: python3.8 -m com2ann -v 6 tests/ (com2ann requires python 3.8 to run)
* Use a database table to hold the users that should have full presence sent ↵Andrew Morgan2021-05-181-4/+11
| | | | to them, instead of something in-memory (#9823)
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Use mock from the stdlib. (#9772)Patrick Cloke2021-04-091-3/+3
|
* Add a Synapse Module for configuring presence update routing (#9491)Andrew Morgan2021-04-061-0/+386
At the moment, if you'd like to share presence between local or remote users, those users must be sharing a room together. This isn't always the most convenient or useful situation though. This PR adds a module to Synapse that will allow deployments to set up extra logic on where presence updates should be routed. The module must implement two methods, `get_users_for_states` and `get_interested_users`. These methods are given presence updates or user IDs and must return information that Synapse will use to grant passing presence updates around. A method is additionally added to `ModuleApi` which allows triggering a set of users to receive the current, online presence information for all users they are considered interested in. This is the equivalent of that user receiving presence information during an initial sync. The goal of this module is to be fairly generic and useful for a variety of applications, with hard requirements being: * Sending state for a specific set or all known users to a defined set of local and remote users. * The ability to trigger an initial sync for specific users, so they receive all current state.