Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the stable hierarchy endpoint from MSC2946 #19738

Closed
clokep opened this issue Nov 12, 2021 · 3 comments · Fixed by matrix-org/matrix-js-sdk#2022 or matrix-org/matrix-js-sdk#2204
Closed
Assignees
Labels
A-Spaces Spaces, groups, communities O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Task Tasks for the team like planning

Comments

@clokep
Copy link

clokep commented Nov 12, 2021

MSC2946 has completed FCP and Synapse is implementing the stable endpoint (see matrix-org/synapse#11329). It would be nice for Element Web to implement the following so that the unstable endpoints can be deprecated:

  • Start using the stable /_matrix/client/v1/rooms/{roomID}/hierarchy endpoint.
  • Ensure that the room_id is not accessed via the list of children_state (this is nested under the room information and should be unnecesary).

This should most likely be implemented to attempt using the stable endpoint before falling back to the unstable endpoint. Please let me know if you have any questions.

@clokep clokep added the A-Spaces Spaces, groups, communities label Nov 12, 2021
@t3chguy t3chguy self-assigned this Nov 15, 2021
@t3chguy t3chguy changed the title Use the stable hierarcy endpoint from MSC2946 Use the stable hierarchy endpoint from MSC2946 Nov 15, 2021
@clokep
Copy link
Author

clokep commented Dec 15, 2021

Thank you! 👍

@t3chguy t3chguy reopened this Dec 17, 2021
@t3chguy
Copy link
Member

t3chguy commented Dec 17, 2021

Unfortunately older Synapse versions return a bad 404 for this API so we cannot sanely fallback.

docker run -it --rm --mount type=volume,src=synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no -p 8008:8008 matrixdotorg/synapse:v1.47.1
#
t3chguy@Michaels-MacBook-Pro ~ [7]> curl "http://localhost:8008/_matrix/client/v1/rooms/!iMZEhwCvbfeAYUxAjZ%3At2l.io/hierarchy?suggested_only=false&limit=20" -vvv
*   Trying 127.0.0.1:8008...
* Connected to localhost (127.0.0.1) port 8008 (#0)
> GET /_matrix/client/v1/rooms/!iMZEhwCvbfeAYUxAjZ%3At2l.io/hierarchy?suggested_only=false&limit=20 HTTP/1.1
> Host: localhost:8008
> User-Agent: curl/7.77.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Server: Synapse/1.47.1
< Date: Fri, 17 Dec 2021 14:12:38 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 167
< 

<html>
  <head><title>404 - No Such Resource</title></head>
  <body>
    <h1>No Such Resource</h1>
    <p>Sorry. No luck finding that resource.</p>
  </body>
</html>
* Connection #0 to host localhost left intact

This is missing an ACAO header and the errcode=M_UNRECOGNIZED JSON error expected.

Due to this the /v1/ API hit is going to rolled back until Synapses with support for this API have been sufficiently rolled out to prevent this issue from becoming widespread.

PR which rolls it back: matrix-org/matrix-js-sdk#2080
PR which will switch back to preferring v1-prefix: matrix-org/matrix-js-sdk#2081

@kittykat kittykat added the T-Task Tasks for the team like planning label Jan 6, 2022
@kittykat kittykat added O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist labels Jan 21, 2022
@richvdh
Copy link
Member

richvdh commented Feb 24, 2022

for reference, matrix-org/synapse#11600 has been fixed, which should prevent this mess in future, but given that any Synapse that has matrix-org/synapse#11600 will also support /_matrix/client/v1/rooms/{roomID}/hierarchy, it doesn't help much in this particular instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spaces Spaces, groups, communities O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Task Tasks for the team like planning
Projects
None yet
4 participants