0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-13 21:41:30 +01:00
synapse/changelog.d
David Robertson ffc2ee521d
Use mypy 1.0 (#15052)
* Update mypy and mypy-zope
* Remove unused ignores

These used to suppress

```
synapse/storage/engines/__init__.py:28: error: "__new__" must return a
class instance (got "NoReturn")  [misc]
```

and

```
synapse/http/matrixfederationclient.py:1270: error: "BaseException" has no attribute "reasons"  [attr-defined]
```

(note that we check `hasattr(e, "reasons")` above)

* Avoid empty body warnings, sometimes by marking methods as abstract

E.g.

```
tests/handlers/test_register.py:58: error: Missing return statement  [empty-body]
tests/handlers/test_register.py:108: error: Missing return statement  [empty-body]
```

* Suppress false positive about `JaegerConfig`

Complaint was

```
synapse/logging/opentracing.py:450: error: Function "Type[Config]" could always be true in boolean context  [truthy-function]
```

* Fix not calling `is_state()`

Oops!

```
tests/rest/client/test_third_party_rules.py:428: error: Function "Callable[[], bool]" could always be true in boolean context  [truthy-function]
```

* Suppress false positives from ParamSpecs

````
synapse/logging/opentracing.py:971: error: Argument 2 to "_custom_sync_async_decorator" has incompatible type "Callable[[Arg(Callable[P, R], 'func'), **P], _GeneratorContextManager[None]]"; expected "Callable[[Callable[P, R], **P], _GeneratorContextManager[None]]"  [arg-type]
synapse/logging/opentracing.py:1017: error: Argument 2 to "_custom_sync_async_decorator" has incompatible type "Callable[[Arg(Callable[P, R], 'func'), **P], _GeneratorContextManager[None]]"; expected "Callable[[Callable[P, R], **P], _GeneratorContextManager[None]]"  [arg-type]
````

* Drive-by improvement to `wrapping_logic` annotation

* Workaround false "unreachable" positives

See https://github.com/Shoobx/mypy-zope/issues/91

```
tests/http/test_proxyagent.py:626: error: Statement is unreachable  [unreachable]
tests/http/test_proxyagent.py:762: error: Statement is unreachable  [unreachable]
tests/http/test_proxyagent.py:826: error: Statement is unreachable  [unreachable]
tests/http/test_proxyagent.py:838: error: Statement is unreachable  [unreachable]
tests/http/test_proxyagent.py:845: error: Statement is unreachable  [unreachable]
tests/http/federation/test_matrix_federation_agent.py:151: error: Statement is unreachable  [unreachable]
tests/http/federation/test_matrix_federation_agent.py:452: error: Statement is unreachable  [unreachable]
tests/logging/test_remote_handler.py:60: error: Statement is unreachable  [unreachable]
tests/logging/test_remote_handler.py:93: error: Statement is unreachable  [unreachable]
tests/logging/test_remote_handler.py:127: error: Statement is unreachable  [unreachable]
tests/logging/test_remote_handler.py:152: error: Statement is unreachable  [unreachable]
```

* Changelog

* Tweak DBAPI2 Protocol to be accepted by mypy 1.0

Some extra context in:
- https://github.com/matrix-org/python-canonicaljson/pull/57
- https://github.com/python/mypy/issues/6002
- https://mypy.readthedocs.io/en/latest/common_issues.html#covariant-subtyping-of-mutable-protocol-members-is-rejected

* Pull in updated canonicaljson lib

so the protocol check just works

* Improve comments in opentracing

I tried to workaround the ignores but found it too much trouble.

I think the corresponding issue is
https://github.com/python/mypy/issues/12909. The mypy repo has a PR
claiming to fix this (https://github.com/python/mypy/pull/14677) which
might mean this gets resolved soon?

* Better annotation for INTERACTIVE_AUTH_CHECKERS

* Drive-by AUTH_TYPE annotation, to remove an ignore
2023-02-16 16:09:11 +00:00
..
.gitignore
13755.misc Return read-only collections from @cached methods (#13755) 2023-02-10 23:29:00 +00:00
13779.bugfix Prevent clients from reporting nonexistent events. (#13779) 2023-02-14 15:50:59 +00:00
14605.bugfix Respond correctly to unknown methods on known endpoints (#14605) 2023-02-09 13:04:24 -05:00
14606.misc Faster joins: don't stall when a user joins during a fast join (#14606) 2023-02-10 23:31:05 +00:00
14675.misc Add a class UnpersistedEventContext to allow for the batching up of storing state groups (#14675) 2023-02-09 13:05:02 -08:00
14742.misc Add check to ensure locked dependencies have source distributions available. (#14742) 2023-02-13 18:15:38 +00:00
14834.misc Tweak comment on _is_local_room_accessible as part of room visibility in /hierarchy to clarify the condition for a room being visible. (#14834) 2023-02-13 16:30:58 +00:00
14840.misc Do not always start a db txn on Postgres (#14840) 2023-02-09 19:57:01 +00:00
14929.misc Change collection[str] to StrCollection in event_auth code (#14929) 2023-02-14 09:37:08 +00:00
14959.doc Clarify limitations of SRV delegation in documentation (#14959) 2023-02-08 10:44:19 +00:00
14964.feature Support for MSC3758: exact_event_match push condition (#14964) 2023-02-10 12:37:07 -05:00
14973.misc Avoid fetching unused account data in sync. (#14973) 2023-02-10 14:22:16 +00:00
14977.misc Limit concurrent event creation for a room to avoid state resolution when sending bursts of events to a local room (#14977) 2023-02-08 11:25:11 -08:00
14980.misc Skip calculating unread push actions in /sync when enable_push is false. (#14980) 2023-02-14 11:10:29 +00:00
14982.misc Make it easier to use DataGrip w/ Synapse's schema (#14982) 2023-02-15 13:51:37 +00:00
15004.feature MSC3873: Escape keys when flattening dicts. (#15004) 2023-02-08 13:09:41 -05:00
15008.misc Typecheck tests.rest.media.v1.test_media_storage (#15008) 2023-02-07 15:24:44 +00:00
15020.misc Bump cryptography from 38.0.4 to 39.0.1 (#15020) 2023-02-08 11:26:10 +00:00
15022.doc Document how to run Synapse (#15022) 2023-02-08 12:58:36 +00:00
15026.misc Explicit disabling of disallowed_untyped_defs. (#15026) 2023-02-08 18:49:18 +00:00
15027.misc Add missing type hints to tests. (#15027) 2023-02-08 19:52:37 +00:00
15028.misc Add more missing type hints to tests. (#15028) 2023-02-08 16:29:49 -05:00
15031.misc Proper types for tests.module_api (#15031) 2023-02-09 00:23:35 +00:00
15033.misc Bump ruff version from 0.0.230 to 0.0.237. (#15033) 2023-02-09 18:18:42 +00:00
15034.feature Support for selecting the Redis logical database. (#15034) 2023-02-15 07:39:31 -05:00
15035.misc Add final type hint to synapse.server. (#15035) 2023-02-09 09:49:04 -05:00
15037.misc Update intentional mentions (MSC3952) to depend on exact_event_match (MSC3758). (#15037) 2023-02-16 09:51:22 -05:00
15038.bugfix Avoid mutating cached room aliases. (#15038) 2023-02-09 15:56:02 +00:00
15040.misc Refactor get_user_devices_from_cache to avoid mutating cached values. (#15040) 2023-02-10 08:09:47 -05:00
15041.misc Fix exception on start up about device lists (#15041) 2023-02-10 09:52:35 +00:00
15042.feature Tag federation request spans with the worker name (#15042) 2023-02-09 22:33:39 +00:00
15043.misc Update pyo3-log to v0.8.1 (#15043) 2023-02-13 12:25:56 +00:00
15045.feature Implement MSC3966: Add a push rule condition to search for a value in an array. (#15045) 2023-02-14 14:02:19 -05:00
15047.misc Avoid mutating cached values in _generate_sync_entry_for_account_data (#15047) 2023-02-10 08:11:20 -05:00
15052.misc Use mypy 1.0 (#15052) 2023-02-16 16:09:11 +00:00
15053.misc Refactor arguments of try_unbind_threepid(_with_id_server) from dict to separate args (#15053) 2023-02-13 12:12:48 +00:00
15054.misc Apply logging from hotfixes branch to develop (#15054) 2023-02-13 11:49:20 +00:00
15059.misc Bump bleach from 5.0.1 to 6.0.0 (#15059) 2023-02-13 09:18:07 +00:00
15060.misc Bump dtolnay/rust-toolchain from 9cd00a88a73addc8617065438eff914dd08d0955 to 25dc93b901a87e864900a8aec6c12e9aa794c0c3 (#15060) 2023-02-13 09:18:26 +00:00
15061.misc Bump systemd-python from 234 to 235 (#15061) 2023-02-13 09:18:50 +00:00
15062.misc Bump serde_json from 1.0.92 to 1.0.93 (#15062) 2023-02-13 09:19:18 +00:00
15063.misc Bump types-requests from 2.28.11.8 to 2.28.11.12 (#15063) 2023-02-13 09:19:28 +00:00
15064.misc Bump types-pillow from 9.4.0.5 to 9.4.0.10 (#15064) 2023-02-13 09:19:39 +00:00
15065.misc Bump sentry-sdk from 1.13.0 to 1.15.0 (#15065) 2023-02-13 09:19:56 +00:00
15068.bugfix Fix order of partial state tables when purging (#15068) 2023-02-14 23:42:29 +00:00
15069.misc Faster joins: Omit device list updates from partial state rooms in /sync (#15069) 2023-02-14 12:32:19 +00:00
15070.misc Fix clashing DB txn name (#15070) 2023-02-14 11:20:25 +00:00
15072.misc Add final type hint to tests.unittest. (#15072) 2023-02-14 14:03:35 -05:00
15073.feature Remove spurious dont_notify action from .m.rule.reaction (#15073) 2023-02-14 18:19:58 +00:00
15074.bugfix Fix federated joins when the first server in the list is not in the room (#15074) 2023-02-15 13:59:06 +00:00
15075.feature Update the error code for duplicate annotation (#15075) 2023-02-15 11:47:57 +00:00
15078.doc Fix a mistake in registration_shared_secret_path docs (#15078) 2023-02-15 19:51:58 +00:00