summary refs log tree commit diff
path: root/tests/handlers/test_typing.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug where typing replication breaks (#17252)Erik Johnston2024-05-311-1/+52
| | | | This can happen on restarts of the service, due to old rooms being pruned.
* 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
|
* Convert state delta processing from a dict to attrs. (#16469)Patrick Cloke2023-10-161-1/+1
| | | For improved type checking & memory usage.
* Some refactors around receipts stream (#16426)Erik Johnston2023-10-041-7/+19
|
* Don't wake up destination transaction queue if they're not due for retry. ↵Erik Johnston2023-09-041-2/+0
| | | | (#16223)
* Don't reset retry timers on "valid" error codes (#16221)Erik Johnston2023-09-041-2/+2
|
* Bump mypy-zope & mypy. (#16188)Patrick Cloke2023-08-291-13/+13
|
* Replace make_awaitable with AsyncMock (#16179)Patrick Cloke2023-08-241-27/+22
| | | | Python 3.8 provides a native AsyncMock, we can replace the homegrown version we have.
* Re-introduce the outbound federation proxy (#15913)Eric Eastwood2023-07-181-0/+10
| | | | | Allow configuring the set of workers to proxy outbound federation traffic through (`outbound_federation_restricted_to`). This is useful when you have a worker setup with `federation_sender` instances responsible for sending outbound federation requests and want to make sure *all* outbound federation traffic goes through those instances. Before this change, the generic workers would still contact federation themselves for things like profile lookups, backfill, etc. This PR allows you to set more strict access controls/firewall for all workers and only allow the `federation_sender`'s to contact the outside world.
* Revert "Federation outbound proxy" (#15910)Eric Eastwood2023-07-101-10/+0
| | | | | | Revert "Federation outbound proxy (#15773)" This reverts commit b07b14b494ae1dd564b4c44f844c9a9545b3d08a.
* Federation outbound proxy (#15773)Eric Eastwood2023-07-051-0/+10
| | | | | | | Allow configuring the set of workers to proxy outbound federation traffic through (`outbound_federation_restricted_to`). This is useful when you have a worker setup with `federation_sender` instances responsible for sending outbound federation requests and want to make sure *all* outbound federation traffic goes through those instances. Before this change, the generic workers would still contact federation themselves for things like profile lookups, backfill, etc. This PR allows you to set more strict access controls/firewall for all workers and only allow the `federation_sender`'s to contact the outside world. The original code is from @erikjohnston's branches which I've gotten in-shape to merge.
* 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.
* Fix type hints in typing edu unit tests (#14886)Andrew Morgan2023-01-261-40/+59
|
* Modernize unit tests configuration settings for workers. (#14568)realtyem2022-12-011-2/+4
| | | | Use the newer foo_instances configuration instead of the deprecated flags to enable specific features (e.g. start_pushers).
* typing: check origin server of typing event against room's servers (#13830)Mathieu Velten2022-09-261-0/+4
| | | | | | | This is also using the partial state approximation if needed so we do not block here during a fast join. Signed-off-by: Mathieu Velten <mathieuv@matrix.org> Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Faster Remote Room Joins: tell remote homeservers that we are unable to ↵reivilibre2022-09-231-1/+1
| | | | authorise them if they query a room which has partial state on our server. (#13823)
* `synapse.api.auth.Auth` cleanup: make permission-related methods use ↵Quentin Gliech2022-08-221-3/+5
| | | | | | | | | `Requester` instead of the `UserID` (#13024) Part of #13019 This changes all the permission-related methods to rely on the Requester instead of the UserID. This is a first step towards enabling scoped access tokens at some point, since I expect the Requester to have scope-related informations in it. It also changes methods which figure out the user/device/appservice out of the access token to return a Requester instead of something else. This avoids having store-related objects in the methods signatures.
* Reduce state pulled from DB due to sending typing and receipts over ↵Erik Johnston2022-06-061-2/+4
| | | | | 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.
* Wait for lazy join to complete when getting current state (#12872)Erik Johnston2022-06-011-1/+1
|
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-271-10/+23
| | | Instead of hard-coding strings in many places.
* Prefer `make_awaitable` over `defer.succeed` in tests (#12505)Sean Quah2022-04-271-3/+3
| | | | | | | | | | | 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>
* Add type hints to tests files. (#12256)Dirk Klimpel2022-03-211-15/+20
|
* Replace assertEquals and friends with non-deprecated versions. (#12092)Patrick Cloke2022-02-281-20/+20
|
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Add type hints for event streams. (#10856)Patrick Cloke2021-09-211-8/+38
|
* Ignore EDUs for rooms we're not in (#10317)Dagfinn Ilmari Mannsåker2021-07-061-0/+37
|
* Don't hammer the database for destination retry timings every ~5mins (#10036)Erik Johnston2021-05-211-7/+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-6/+6
| | | | | | | - 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
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-151-1/+1
| | | | This was never used, so let's get rid of it.
* Merge pull request #8858 from matrix-org/rav/sso_uiaRichard van der Hoff2020-12-021-3/+8
|\ | | | | UIA: offer only available auth flows
| * fix up various test casesRichard van der Hoff2020-12-021-3/+8
| | | | | | | | | | A few test cases were relying on being able to mount non-client servlets on the test resource. it's better to give them their own Resources.
* | Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-021-3/+3
|/ | | | | | | | | | | | Replaces the `federation_ip_range_blacklist` configuration setting with an `ip_range_blacklist` setting with wider scope. It now applies to: * Federation * Identity servers * Push notifications * Checking key validitity for third-party invite events The old `federation_ip_range_blacklist` setting is still honored if present, but with reduced scope (it only applies to federation and identity servers).
* Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-161-1/+0
|
* Move additional tasks to the background worker, part 4 (#8513)Patrick Cloke2020-10-131-34/+14
|
* Catch-up after Federation Outage (split, 4): catch-up loop (#8272)reivilibre2020-09-151-0/+5
|
* Fixup pusher pool notifications (#8287)Erik Johnston2020-09-091-0/+1
| | | | | `pusher_pool.on_new_notifications` expected a min and max stream ID, however that was not what we were passing in. Instead, let's just pass it the current max stream ID and have it track the last stream ID it got passed. I believe that it mostly worked as we called the function for every event. However, it would break for events that got persisted out of order, i.e, that were persisted but the max stream ID wasn't incremented as not all preceding events had finished persisting, and push for that event would be delayed until another event got pushed to the effected users.
* Revert "Fixup pusher pool notifications"Erik Johnston2020-09-091-1/+0
| | | | This reverts commit e7fd336a53a4ca489cdafc389b494d5477019dc0.
* Fixup pusher pool notificationsErik Johnston2020-09-091-0/+1
|
* Allow for make_awaitable's return value to be re-used. (#8261)Patrick Cloke2020-09-081-1/+1
|
* Do not yield on awaitables in tests. (#8193)Patrick Cloke2020-08-271-1/+3
|
* Do not propagate typing notifications from shadow-banned users. (#8176)Patrick Cloke2020-08-261-6/+20
|
* Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke2020-08-261-2/+2
|
* Convert some of the general database methods to async (#8100)Patrick Cloke2020-08-171-1/+1
|
* Convert devices database to async/await. (#8069)Patrick Cloke2020-08-121-1/+1
|
* Convert account data, device inbox, and censor events databases to ↵Patrick Cloke2020-08-121-1/+2
| | | | async/await (#8063)
* Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-061-2/+2
|
* Fix testsErik Johnston2020-07-151-2/+2
|
* Convert the typing handler to async/await. (#7679)Patrick Cloke2020-06-171-6/+7
|
* Add ability to wait for replication streams (#7542)Erik Johnston2020-05-221-1/+4
| | | | | | | 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.
* Store room version on invite (#6983)Richard van der Hoff2020-02-261-0/+1
| | | | | When we get an invite over federation, store the room version in the rooms table. The general idea here is that, when we pull the invite out again, we'll want to know what room_version it belongs to (so that we can later redact it if need be). So we need to store it somewhere...
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-3/+3
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Refactor the membership check methods in AuthRichard van der Hoff2020-02-181-2/+2
| | | | | these were getting a bit unwieldy, so let's combine `check_joined_room` and `check_user_was_in_room` into a single `check_user_in_room`.
* Add typing to synapse.federation.sender (#6871)Erik Johnston2020-02-071-2/+6
|
* Resync remote device list when detected as stale. (#6786)Erik Johnston2020-01-301-3/+3
|
* Add database config class (#6513)Erik Johnston2019-12-181-19/+20
| | | | | This encapsulates config for a given database and is the way to get new connections.
* Fixup functions to consistently return deferredsErik Johnston2019-12-061-6/+18
|
* Implementation of MSC2314 (#6176)Amber Brown2019-11-281-0/+3
|
* rename get_devices_by_remote to get_device_updates_by_remoteHubert Chathi2019-10-301-2/+2
|
* Port federation_server to async/awaitErik Johnston2019-10-291-0/+3
|
* Fix races in room stats (and other) updates. (#6187)Richard van der Hoff2019-10-101-1/+1
| | | | | | | Hopefully this will fix the occasional failures we were seeing in the room directory. The problem was that events are not necessarily persisted (and `current_state_delta_stream` updated) in the same order as their stream_id. So for instance current_state_delta 9 might be persisted *before* current_state_delta 8. Then, when the room stats saw stream_id 9, it assumed it had done everything up to 9, and never came back to do stream_id 8. We can solve this easily by only processing up to the stream_id where we know all events have been persisted.
* Add 'failure_ts' column to 'destinations' table (#6016)Richard van der Hoff2019-09-171-1/+6
| | | | Track the time that a server started failing at, for general analysis purposes.
* Run Black. (#5482)Amber Brown2019-06-201-8/+8
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-93/+59
|
* Fix grammar and document get_current_users_in_room (#4998)Andrew Morgan2019-04-031-2/+2
|
* Make federation endpoints more tolerant of trailing slashes v2 (#4935)Andrew Morgan2019-03-261-3/+3
| | | Redo of https://github.com/matrix-org/synapse/pull/4840
* Remove trailing slashes from outbound federation requests and retry on 400 ↵Andrew Morgan2019-03-211-0/+2
|\ | | | | | | | | (#4840) As per #3622, we remove trailing slashes from outbound federation requests. However, to ensure that we remain backwards compatible with previous versions of Synapse, if we receive a HTTP 400 with `M_UNRECOGNIZED`, then we are likely talking to an older version of Synapse in which case we retry with a trailing slash appended to the request path.
| * Switch to wrapper function around _send_requestAndrew Morgan2019-03-131-2/+2
| |
| * Correct argument nameAndrew Morgan2019-03-121-2/+2
| |
| * Cleaner way of implementing trailing slashesAndrew Morgan2019-03-121-2/+4
| |
| * and againAndrew Morgan2019-03-111-1/+1
| |
| * Fix syntax errorAndrew Morgan2019-03-111-1/+1
| |
| * We're calling different functions nowAndrew Morgan2019-03-111-2/+2
| |
* | Revert "Make federation endpoints more tolerant of trailing slashes for some ↵Erik Johnston2019-03-141-3/+3
|/ | | | | | endpoints (#4793)" This reverts commit 290552fd836f4ae2dc1d893a7f72f7fff85365d3.
* Make federation endpoints more tolerant of trailing slashes for some ↵Andrew Morgan2019-03-111-3/+3
| | | | | endpoints (#4793) Server side of a solution towards #3622.
* Update test_typing to use HomeserverTestCase. (#4771)Richard van der Hoff2019-03-041-157/+133
|
* Port tests/ to Python 3 (#3808)Amber Brown2018-09-071-3/+1
|
* Fix origin handling for pushed transactionsRichard van der Hoff2018-09-051-11/+8
| | | | | Use the actual origin for push transactions, rather than whatever the remote server claimed.
* Run tests under PostgreSQL (#3423)Amber Brown2018-08-131-0/+1
|
* Run black.black2018-08-101-116/+115
|
* Test fixes for Python 3 (#3647)Amber Brown2018-08-091-1/+3
|
* Remove pdu_failures from transactionsTravis Ralston2018-07-301-1/+0
| | | The field is never read from, and all the opportunities given to populate it are not utilized. It should be very safe to remove this.
* run isortAmber Brown2018-07-091-7/+12
|
* Fix testsErik Johnston2018-03-131-1/+1
|
* try make tests work a bit more...Matthew Hodgson2017-12-041-0/+12
|
* erik told me toMatthew Hodgson2017-12-041-1/+1
|
* push federation retry limiter down to matrixfederationclientRichard van der Hoff2017-03-231-0/+2
| | | | | rather than having to instrument everywhere we make a federation call, make the MatrixFederationHttpClient manage the retry limiter.
* Add basic implementation of local device list changesErik Johnston2017-01-251-0/+3
|
* Merge pull request #1098 from matrix-org/markjh/bearer_tokenMark Haines2016-10-251-1/+2
|\ | | | | Allow clients to supply access_tokens as headers
| * Fix unit testsMark Haines2016-09-121-1/+2
| |
* | Time out typing over federationErik Johnston2016-09-231-5/+2
|/
* Fix unit testsMark Haines2016-09-061-0/+8
|
* Fix unit testsErik Johnston2016-08-261-0/+6
|
* Store the typing users as user_id strings. (#819)Mark Haines2016-06-021-2/+2
| | | Rather than storing them as UserID objects.
* Move typing handler out of the Handlers objectMark Haines2016-05-171-9/+1
|
* Replaces calls to fetch_room_distributions_into with get_joined_hosts_for_roomMark Haines2016-05-161-44/+5
|
* Fix flake8 warnings for testsMark Haines2016-02-191-60/+55
|
* Delete the table objects from TransactionStoreMark Haines2016-01-131-1/+0
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Update testsErik Johnston2015-11-171-0/+2
|
* Open up /events to anonymous users for room events onlyDaniel Wagner-Hall2015-11-051-6/+24
| | | | Squash-merge of PR #345 from daniel/anonymousevents
* Consolidate duplicate code in notifierErik Johnston2015-07-021-10/+10
|
* Don't bother checking for updates if the stream token hasn't advanced for a userMark Haines2015-05-131-6/+6
|
* Merge branch 'develop' of github.com:matrix-org/synapse into postgresErik Johnston2015-04-171-6/+19
|\
| * Various minor fixes to unit-test structure around typing notificationsPaul "LeoNerd" Evans2015-04-151-0/+7
| |
| * Have TypingNotificationEventSource.get_new_events_for_user() return a ↵Paul "LeoNerd" Evans2015-04-151-6/+12
| | | | | | | | deferred, for consistency and extensibility
* | Make work in both Maria and SQLite. Fix testsErik Johnston2015-04-011-1/+6
|/
* Factor out some of the common homeserver setup code into aMark Haines2015-02-111-25/+22
| | | | setup_test_homeserver function in utils.
* Replace hs.parse_userid with UserID.from_stringMark Haines2015-01-231-3/+4
|
* Check that setting typing notification still works after explicit timeout - ↵Paul "LeoNerd" Evans2015-01-121-0/+26
| | | | SYN-230
* Merge branch 'develop' of github.com:matrix-org/synapse into events_refactorErik Johnston2014-12-151-22/+118
|\ | | | | | | | | Conflicts: tests/handlers/test_room.py
| * Send list of typing user IDs as 'user_ids' list within 'content', so that ↵Paul "LeoNerd" Evans2014-12-121-5/+15
| | | | | | | | m.typing stream events have a toplevel content, for consistency with others
| * Actually auth-check to ensure people can only send typing notifications for ↵Paul "LeoNerd" Evans2014-12-111-0/+10
| | | | | | | | rooms they're actually in
| * Hook up the event stream to typing notificationsPaul "LeoNerd" Evans2014-12-101-0/+60
| |
| * Store serial numbers per room for typing event stream purposesPaul "LeoNerd" Evans2014-12-101-30/+16
| |
| * First hack at implementing timeouts in typing notification handlerPaul "LeoNerd" Evans2014-12-101-3/+33
| |
* | Fix some testsErik Johnston2014-12-101-1/+1
|/
* Add newline back inErik Johnston2014-12-101-0/+1
|
* Remove whitespaceErik Johnston2014-12-101-1/+1
|
* fix UTs by telling all the mock stores about the new methods for tracking ↵Matthew Hodgson2014-12-091-2/+7
| | | | retries
* SYN-103: Remove "origin" and "destination" keys from edusMark Haines2014-11-131-3/+0
|
* Fix typing testsErik Johnston2014-11-051-0/+1
|
* SPEC-7: Rename 'ts' to 'origin_server_ts'Mark Haines2014-10-171-1/+1
|
* SYN-103: Ignore the 'origin' key in received EDUs. Instead take the origin ↵Mark Haines2014-10-141-0/+1
| | | | from the transaction itself
* SYN-75 sign at the request level rather than the transaction levelMark Haines2014-10-131-2/+2
|
* SYN-75 Verify signatures on server to server transactionsMark Haines2014-09-301-0/+1
|
* Sign federation transactionsMark Haines2014-09-241-1/+5
|
* Fix unit tests after adding extra argument on put_jsonErik Johnston2014-09-151-2/+4
|
* Have all unit tests import from our own subclass of trial's unittest ↵Paul "LeoNerd" Evans2014-09-121-5/+1
| | | | TestCase; set up logging in ONE PLACE ONLY
* fix the copyright holder from matrix.org to OpenMarket Ltd, as matrix.org ↵Matthew Hodgson2014-09-031-1/+1
| | | | hasn't been incorporated in time for launch.
* change the world: make the default matrix API URL prefix /_matrix rather ↵Matthew Hodgson2014-08-311-3/+3
| | | | | | than /matrix to make it easier for existing websites to mount a HS in their namespace without collisions. perl -pi -e 's#/matrix#/_matrix#g' ./cmdclient/console.py ./docs/client-server/howto.rst ./docs/client-server/specification.rst ./docs/client-server/swagger_matrix/directory ./docs/client-server/swagger_matrix/events ./docs/client-server/swagger_matrix/login ./docs/client-server/swagger_matrix/presence ./docs/client-server/swagger_matrix/profile ./docs/client-server/swagger_matrix/registration ./docs/client-server/swagger_matrix/rooms ./docs/server-server/specification.rst ./graph/graph.py ./jsfiddles/create_room_send_msg/demo.js ./jsfiddles/event_stream/demo.js ./jsfiddles/example_app/demo.js ./jsfiddles/register_login/demo.js ./jsfiddles/room_memberships/demo.js ./synapse/api/urls.py ./tests/federation/test_federation.py ./tests/handlers/test_presence.py ./tests/handlers/test_typing.py ./tests/rest/test_events.py ./tests/rest/test_presence.py ./tests/rest/test_profile.py ./tests/rest/test_rooms.py ./webclient/components/fileUpload/file-upload-service.js ./webclient/components/matrix/matrix-service.js
* Initial typing notification support - EDU federation, but no timers, and no ↵Paul "LeoNerd" Evans2014-08-271-0/+250
actual push to clients