Skip to content

Commit

Permalink
Check for r0.6.0 support in addition to unstable feature flags
Browse files Browse the repository at this point in the history
To avoid the same problem that happened with lazy-loading (see matrix-org/synapse#5528).

Note that as of writing r0.6.0 is not yet released, however it is the next scheduled release of the client-server API.
  • Loading branch information
turt2live committed Sep 16, 2019
1 parent d9bb0e9 commit eeb2c46
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4196,6 +4196,13 @@ MatrixClient.prototype.doesServerSupportLazyLoading = async function() {
MatrixClient.prototype.doesServerRequireIdServerParam = async function() {
const response = await this.getVersions();

const versions = response["versions"];

// Supporting r0.6.0 is the same as having the flag set to false
if (versions && versions.includes("r0.6.0")) {
return false;
}

const unstableFeatures = response["unstable_features"];
if (unstableFeatures["m.require_identity_server"] === undefined) {
return true;
Expand All @@ -4213,12 +4220,11 @@ MatrixClient.prototype.doesServerRequireIdServerParam = async function() {
MatrixClient.prototype.doesServerAcceptIdentityAccessToken = async function() {
const response = await this.getVersions();

const versions = response["versions"];
const unstableFeatures = response["unstable_features"];
if (unstableFeatures["m.id_access_token"] === undefined) {
return false;
}

return unstableFeatures["m.id_access_token"];
return (versions && versions.includes("r0.6.0"))
|| (unstableFeatures && unstableFeatures["m.id_access_token"]);
};

/*
Expand Down

0 comments on commit eeb2c46

Please sign in to comment.