summary refs log tree commit diff
path: root/tests/federation/test_federation_sender.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Use full GitHub links instead of bare issue numbers. (#16637)Patrick Cloke2023-11-151-1/+1
|
* Don't wake up destination transaction queue if they're not due for retry. ↵Erik Johnston2023-09-041-9/+18
| | | | (#16223)
* Bump mypy-zope & mypy. (#16188)Patrick Cloke2023-08-291-2/+2
|
* Replace make_awaitable with AsyncMock (#16179)Patrick Cloke2023-08-241-22/+20
| | | | Python 3.8 provides a native AsyncMock, we can replace the homegrown version we have.
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-141-31/+24
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Type hints for tests.federation (#14991)David Robertson2023-02-061-33/+41
| | | | | | | | | | | | | * Make tests.federation pass mypy * Untyped defs in tests.federation.transport * test methods return None * Remaining type hints in tests.federation * Changelog * Avoid an uncessary type-ignore
* Modernize unit tests configuration settings for workers. (#14568)realtyem2022-12-011-5/+22
| | | | Use the newer foo_instances configuration instead of the deprecated flags to enable specific features (e.g. start_pushers).
* Use servers list approx to send read receipts when in partial state (#14549)Mathieu Velten2022-11-301-0/+4
| | | Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
* Include thread information when sending receipts over federation. (#14466)Patrick Cloke2022-11-281-0/+77
| | | | | | | | | | | | Include the thread_id field when sending read receipts over federation. This might result in the same user having multiple read receipts per-room, meaning multiple EDUs must be sent to encapsulate those receipts. This restructures the PerDestinationQueue APIs to support multiple receipt EDUs, queue_read_receipt now becomes linear time in the number of queued threaded receipts in the room for the given user, it is expected this is a small number since receipt EDUs are sent as filler in transactions.
* Accept & store thread IDs for receipts (implement MSC3771). (#13782)Patrick Cloke2022-09-231-3/+18
| | | | Updates the `/receipts` endpoint and receipt EDU handler to parse a `thread_id` from the body and insert it in the database.
* Update `get_users_in_room` mis-use to get hosts with dedicated ↵Eric Eastwood2022-08-241-5/+12
| | | | | `get_current_hosts_in_room` (#13605) See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755
* Reduce state pulled from DB due to sending typing and receipts over ↵Erik Johnston2022-06-061-7/+7
| | | | | federation (#12964) Reducing the amount of state we pull from the DB is useful as fetching state is expensive in terms of DB, CPU and memory.
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-271-12/+14
| | | Instead of hard-coding strings in many places.
* Prefer `make_awaitable` over `defer.succeed` in tests (#12505)Sean Quah2022-04-271-1/+1
| | | | | | | | | | | When configuring the return values of mocks, prefer awaitables from `make_awaitable` over `defer.succeed`. `Deferred`s are only awaitable once, so it is inappropriate for a mock to return the same `Deferred` multiple times. Also update `run_in_background` to support functions that return arbitrary awaitables. Signed-off-by: Sean Quah <seanq@element.io>
* Only send out device list updates for our own users (#12465)Erik Johnston2022-04-141-1/+42
| | | Broke in #12365
* Process device list updates asynchronously (#12365)Erik Johnston2022-04-121-8/+0
|
* Track device list updates per room. (#12321)Erik Johnston2022-04-041-6/+17
| | | | | | | | | | | | | | This is a first step in dealing with #7721. The idea is basically that rather than calculating the full set of users a device list update needs to be sent to up front, we instead simply record the rooms the user was in at the time of the change. This will allow a few things: 1. we can defer calculating the set of remote servers that need to be poked about the change; and 2. during `/sync` and `/keys/changes` we can avoid also avoid calculating users who share rooms with other users, and instead just look at the rooms that have changed. However, care needs to be taken to correctly handle server downgrades. As such this PR writes to both `device_lists_changes_in_room` and the `device_lists_outbound_pokes` table synchronously. In a future release we can then bump the database schema compat version to `69` and then we can assume that the new `device_lists_changes_in_room` exists and is handled. There is a temporary option to disable writing to `device_lists_outbound_pokes` synchronously, allowing us to test the new code path does work (and by implication upgrading to a future release and downgrading to this one will work correctly). Note: Ideally we'd do the calculation of room to servers on a worker (e.g. the background worker), but currently only master can write to the `device_list_outbound_pokes` table.
* Spread out sending device lists to remote hosts (#12132)Erik Johnston2022-03-041-4/+48
|
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-3/+3
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Send and handle cross-signing messages using the stable prefix. (#10520)Hubert Chathi2021-12-081-2/+3
|
* Fix errors in Synapse logs from unit tests. (#10939)Patrick Cloke2021-09-301-3/+3
| | | | | Fix some harmless errors from background processes (mostly due to awaiting Mock objects) that occurred in the Synapse logs during unit tests.
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-1/+1
|
* 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-2/+1
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-5/+10
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Allow for make_awaitable's return value to be re-used. (#8261)Patrick Cloke2020-09-081-1/+1
|
* Convert federation client to async/await. (#7975)Patrick Cloke2020-07-301-5/+5
|
* Convert state resolution to async/await (#7942)Patrick Cloke2020-07-241-12/+7
|
* Add option to enable encryption by default for new rooms (#7639)Andrew Morgan2020-06-101-1/+5
| | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/2431 Adds config option `encryption_enabled_by_default_for_room_type`, which determines whether encryption should be enabled with the default encryption algorithm in private or public rooms upon creation. Whether the room is private or public is decided based upon the room creation preset that is used. Part of this PR is also pulling out all of the individual instances of `m.megolm.v1.aes-sha2` into a constant variable to eliminate typos ala https://github.com/matrix-org/synapse/pull/7637 Based on #7637
* Fix encryption algorithm typos in tests/comments (#7637)Andrew Morgan2020-06-041-1/+1
| | | | | | | | @uhoreg has confirmed these were both typos. They are only in comments and tests though, rather than anything critical. Introduced in: * https://github.com/matrix-org/synapse/pull/7157 * https://github.com/matrix-org/synapse/pull/5726
* Fix device list update stream ids going backward (#7158)Richard van der Hoff2020-04-031-0/+6
| | | | | | | | | | | | | | | | Occasionally we could get a federation device list update transaction which looked like: ``` [ {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D2', 'prev_id': [], 'stream_id': 12, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D1', 'prev_id': [12], 'stream_id': 11, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D3', 'prev_id': [11], 'stream_id': 13, 'deleted': True}} ] ``` Having `stream_ids` which are lower than `prev_ids` looks odd. It might work (I'm not actually sure), but in any case it doesn't seem like a reasonable thing to expect other implementations to support.
* Rewrite prune_old_outbound_device_pokes for efficiency (#7159)Richard van der Hoff2020-03-301-0/+92
| | | | make sure we clear out all but one update for the user
* Add tests for outbound device pokesRichard van der Hoff2020-03-271-3/+300
|
* Implementation of MSC2314 (#6176)Amber Brown2019-11-281-1/+3
|
* Run Black. (#5482)Amber Brown2019-06-201-24/+24
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-47/+66
|
* Batch up outgoing read-receipts to reduce federation traffic. (#4890)Richard van der Hoff2019-03-201-0/+128
Rate-limit outgoing read-receipts as per #4730.