summary refs log tree commit diff
path: root/tests/test_visibility.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update ruff config (#16283)Patrick Cloke2023-09-081-4/+4
| | | Enable additional checks & clean-up unneeded configuration.
* Run pyupgrade for python 3.7 & 3.8. (#16110)Patrick Cloke2023-08-151-1/+1
|
* Refactor `filter_events_for_server` (#15240)David Robertson2023-03-101-5/+35
| | | | | | | | | | | | | | | | | * Tweak docstring and type hint * Flip logic and provide better name * Separate decision from action * Track a set of strings, not EventBases * Require explicit boolean options from callers * Add explicit option for partial state rooms * Changelog * Rename param
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-141-10/+6
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Add a class UnpersistedEventContext to allow for the batching up of storing ↵Shay2023-02-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state groups (#14675) * add class UnpersistedEventContext * modify create new client event to create unpersistedeventcontexts * persist event contexts after creation * fix tests to persist unpersisted event contexts * cleanup * misc lints + cleanup * changelog + fix comments * lints * fix batch insertion? * reduce redundant calculation * add unpersisted event classes * rework compute_event_context, split into function that returns unpersisted event context and then persists it * use calculate_context_info to create unpersisted event contexts * update typing * $%#^&* * black * fix comments and consolidate classes, use attr.s for class * requested changes * lint * requested changes * requested changes * refactor to be stupidly explicit * clearer renaming and flow * make partial state non-optional * update docstrings --------- Co-authored-by: Erik Johnston <erik@matrix.org>
* Add more missing type hints to tests. (#15028)Patrick Cloke2023-02-081-1/+1
|
* Faster joins: filter out non local events when a room doesn't have its full ↵Mathieu Velten2022-11-211-5/+5
| | | | | | state (#14404) Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
* Rename test case method to `add_hashes_and_signatures_from_other_server` ↵David Robertson2022-07-121-1/+1
| | | | (#13255)
* Rename storage classes (#12913)Erik Johnston2022-05-311-13/+33
|
* Refactor `EventContext` (#12689)Erik Johnston2022-05-101-1/+3
| | | | | | | | | | Refactor how the `EventContext` class works, with the intention of reducing the amount of state we fetch from the DB during event processing. The idea here is to get rid of the cached `current_state_ids` and `prev_state_ids` that live in the `EventContext`, and instead defer straight to the database (and its caching). One change that may have a noticeable effect is that we now no longer prefill the `get_current_state_ids` cache on a state change. However, that query is relatively light, since its just a case of reading a table from the DB (unlike fetching state at an event which is more heavyweight). For deployments with workers this cache isn't even used. Part of #12684
* Remove redundant `get_success` calls in test code (#12346)Richard van der Hoff2022-04-011-14/+12
| | | There are a bunch of places we call get_success on an immediate value, which is unnecessary. Let's rip them out, and remove the redundant functionality in get_success and friends.
* Handle outliers in `/federation/v1/event` (#12332)Richard van der Hoff2022-03-311-0/+53
| | | | | | | The intention here is to avoid doing state lookups for outliers in `/_matrix/federation/v1/event`. Unfortunately that's expanded into something of a rewrite of `filter_events_for_server`, which ended up trying to do that operation in a couple of places.
* Update client-visibility filtering for outlier events (#12155)Richard van der Hoff2022-03-041-3/+73
| | | Avoid trying to get the state for outliers, which isn't a sensible thing to do.
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+3
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Clean up `tests.test_visibility` to remove legacy code. (#11495)reivilibre2021-12-021-202/+39
|
* 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
|
* Bugbear: Add Mutable Parameter fixes (#9682)Jonathan de Jong2021-04-081-2/+5
| | | | | | | Part of #9366 Adds in fixes for B006 and B008, both relating to mutable parameter lint errors. Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Do not yield on awaitables in tests. (#8193)Patrick Cloke2020-08-271-2/+3
|
* Convert storage layer to async/await. (#7963)Patrick Cloke2020-07-281-4/+10
|
* Convert groups and visibility code to async / await. (#7951)Patrick Cloke2020-07-271-6/+6
|
* Convert the message handler to async/await. (#7884)Patrick Cloke2020-07-221-7/+7
|
* Port to use state storageErik Johnston2019-10-301-2/+9
|
* Use new EventPersistenceStoreErik Johnston2019-10-231-3/+4
|
* Remove test debugsErik Johnston2019-08-201-1/+0
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-3/+3
|
* Run Black. (#5482)Amber Brown2019-06-201-1/+1
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-3/+3
|
* Collect room-version variations into one place (#4969)Richard van der Hoff2019-04-011-4/+4
| | | | Collect all the things that make room-versions different to one another into one place, so that it's easier to define new room versions.
* Fix test to use valid event formatErik Johnston2019-01-291-1/+1
|
* Fix testsErik Johnston2019-01-251-0/+4
|
* Revert "Require event format version to parse or create events"Erik Johnston2019-01-251-4/+0
|
* Fix testsErik Johnston2019-01-241-0/+4
|
* Fix tests on postgresql (#3740)Amber Brown2018-09-041-1/+1
|
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-08-201-72/+75
|\ | | | | | | erikj/refactor_state_handler
| * Run tests under PostgreSQL (#3423)Amber Brown2018-08-131-1/+1
| |
| * Run black.black2018-08-101-71/+74
| |
* | Fix testsErik Johnston2018-08-091-1/+3
|/
* Fix visibility of events from erased users over federationRichard van der Hoff2018-07-171-0/+63
|
* fix importsRichard van der Hoff2018-07-171-0/+1
|
* Add a test which profiles filter_events_for_server in a large roomRichard van der Hoff2018-07-161-2/+155
|
* Move filter_events_for_server out of FederationHandlerRichard van der Hoff2018-07-161-0/+107
for easier unit testing.