You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replication servlet classes, such as ReplicationRemoteJoinRestServlet, ReplicationUserDevicesResyncRestServlet etc. each have _serialize_payload and _handle_request methods. Traditionally we haven't added typing to these methods as it breaks mypy for two reasons:
Their signatures differ from the base methods in ReplicationEndpoint.
If types are added to any instance of _serialize_payload or _handle_request, mypy will complain about this discrepancy, and thus an # type: ignore has typically been put on the method signature in order to avoid this:
A better solution is to write a mypy plugin, much like we already have for cache functions to properly check the types and remove the need to ignore them.
This issue has been migrated from #8828.
Replication servlet classes, such as
ReplicationRemoteJoinRestServlet
,ReplicationUserDevicesResyncRestServlet
etc. each have_serialize_payload
and_handle_request
methods. Traditionally we haven't added typing to these methods as it breaks mypy for two reasons:ReplicationEndpoint
.send_request
, which is what is returned bymake_client
and what is run when making a replication request.If types are added to any instance of
_serialize_payload
or_handle_request
,mypy
will complain about this discrepancy, and thus an# type: ignore
has typically been put on the method signature in order to avoid this:https://github.com/matrix-org/synapse/blob/377673db2ac4b4af6a237252dc39cf464cfb3a30/synapse/replication/http/membership.py#L55-L62
A better solution is to write a mypy plugin, much like we already have for cache functions to properly check the types and remove the need to ignore them.
Note that this issue grew out of a discussion here: matrix-org/synapse#8809 (comment)
The text was updated successfully, but these errors were encountered: