1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Stop using v1-prefixed /hierarchy API due to Synapse bugs (#2080)

This commit is contained in:
Michael Telatynski
2021-12-17 15:33:55 +00:00
committed by GitHub
parent 36906e2ddb
commit dd0ca91aa9

View File

@@ -50,7 +50,6 @@ import {
PREFIX_IDENTITY_V2,
PREFIX_MEDIA_R0,
PREFIX_R0,
PREFIX_V1,
PREFIX_UNSTABLE,
retryNetworkOperation,
UploadContentResponseType,
@@ -8394,21 +8393,7 @@ export class MatrixClient extends EventEmitter {
from: fromToken,
limit: limit?.toString(),
}, undefined, {
prefix: PREFIX_V1,
}).catch(e => {
if (e.errcode === "M_UNRECOGNIZED") {
// fall back to the development prefix
return this.http.authedRequest<IRoomHierarchy>(undefined, Method.Get, path, {
suggested_only: String(suggestedOnly),
max_depth: String(maxDepth),
from: fromToken,
limit: String(limit),
}, undefined, {
prefix: "/_matrix/client/unstable/org.matrix.msc2946",
});
}
throw e;
prefix: "/_matrix/client/unstable/org.matrix.msc2946",
}).catch(e => {
if (e.errcode === "M_UNRECOGNIZED") {
// fall back to the older space summary API as it exposes the same data just in a different shape.