element-hq / element-hq/synapse

Remove the 'shorthand' option from `tests.server.make_request`

Open
#12,103 0 comments 0 reactions 0 assignees View on GitHub
A-Testing O-Uncommon S-Tolerable T-Task Z-Dev-Wishlist Z-Help-Wanted
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#12103](https://github.com/matrix-org/synapse/issues/12103).

---

With Matrix 1.1 came the [decoupling of Client API endpoint versions from the overall spec version](https://spec.matrix.org/v1.2/#endpoint-versioning). This means that individual CS APIs can now have their own version (i.e. `/_matrix/client/v3/login` vs. `/_matrix/client/v4/profile`).

This conflicts with the assumption made by the default enabled `shorthand` option of `tests.server.make_request`, which prepends `/_matrix/client/r0/` to request paths if a prefix is not already specified.

https://github.com/matrix-org/synapse/blob/807efd26aec9b65c6a2f02d10fd139095a5b3387/tests/server.py#L271-L272

https://github.com/matrix-org/synapse/blob/807efd26aec9b65c6a2f02d10fd139095a5b3387/tests/server.py#L293-L301

This cannot simply be updated from `/r0` to `/v3`, as that will be invalid as soon as one of the many CS APIs updates its version. Instead, I propose the option be removed, and all calls to the endpoint be updated to include the correct path prefix.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.