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

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

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
PREFIX_IDENTITY_V2,
PREFIX_MEDIA_R0,
PREFIX_R0,
PREFIX_V1,
PREFIX_UNSTABLE,
retryNetworkOperation,
UploadContentResponseType,
Expand Down Expand Up @@ -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.
Expand Down