anonymousland-synapse/synapse
David Robertson 74e4419eb4
Fix another jsonschema typecheck error (#11830)
Similar to #11817.

In `_create_power_level_validator` we
- retrieve `validator`. This is a class implementing the
  `jsonschema.protocols.Validator` interface. In other words,
  `validator: Type[jsonschema.protocols.Validator]`.
- we then create an second validator class by modifying the original
  `validator`. We return that class, which is also of type
  `Type[jsonschema.protocols.Validator]`.

So the original annotation was incorrect: it claimed we were returning
an instance of jsonSchema.Draft7Validator, not the class (or a subclass)
itself. (Strictly speaking this is incorrect, because `POWER_LEVELS_SCHEMA`
isn't pinned to a particular version of JSON Schema. But there are other
complications with the type stubs if you try to fix this; I felt like
the change herein was a decent compromise that better expresses intent).

(I suspect/hope the typeshed project would welcome an effort to improve
the jsonschema stubs. Let's see if I get some spare time.)
2022-01-25 15:29:28 -05:00
..
_scripts Add a flag to the synapse_review_recent_signups script to ignore and filter appservice users. (#11675) 2022-01-17 16:43:25 +00:00
api Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
app Check that gc method is available before using in synapse/app/_base (#11816) 2022-01-25 10:35:18 -08:00
appservice Add missing type hints to synapse.appservice (#11360) 2021-12-14 17:02:46 +00:00
config Add deprecation warnings for webclient listener and non-HTTP(S) web_client_location. (#11774) 2022-01-20 14:21:06 +00:00
crypto Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
events Fix another jsonschema typecheck error (#11830) 2022-01-25 15:29:28 -05:00
federation Add admin API to reset connection timeouts for remote server (#11639) 2022-01-25 12:06:29 +00:00
groups
handlers Remove account data (including client config, push rules and ignored users) upon user deactivation. (#11621) 2022-01-24 13:37:00 +00:00
http Apply a timeout to reading the body when fetching a file. (#11784) 2022-01-24 14:38:37 +00:00
logging Add missing auto_attribs=True to the _WrappedRustReporter class (#11768) 2022-01-19 12:39:11 +00:00
metrics Fix mypy for platforms without epoll support. (#11771) 2022-01-19 16:50:09 +00:00
module_api Fix ModuleApi.looping_background_call for non-async functions (#11524) 2021-12-07 11:41:31 +00:00
push Fix missing app variable in mail subject (#11745) 2022-01-13 20:19:10 +00:00
replication Stop reading from event_reference_hashes (#11794) 2022-01-21 09:18:10 +00:00
res
rest Add admin API to get a list of federated rooms (#11658) 2022-01-25 16:11:40 +00:00
server_notices
spam_checker_api
state Remove log_function and its uses (#11761) 2022-01-18 13:06:04 +00:00
static
storage Add admin API to get a list of federated rooms (#11658) 2022-01-25 16:11:40 +00:00
streams Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
util Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
__init__.py Merge branch 'master' into develop 2022-01-25 12:52:27 +00:00
event_auth.py
notifier.py Remove log_function and its uses (#11761) 2022-01-18 13:06:04 +00:00
py.typed
python_dependencies.py Drop support for and remove references to EOL Python 3.6 (#11683) 2022-01-21 14:23:26 -08:00
server.py Bundle aggregations outside of the serialization method. (#11612) 2022-01-07 09:10:46 -05:00
types.py Use auto_attribs/native type hints for attrs classes. (#11692) 2022-01-13 13:49:28 +00:00
visibility.py Make the get_global_account_data_by_type_for_user cache be a tree-cache whose key is prefixed with the user ID (#11788) 2022-01-21 08:38:36 +00:00