1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-31 15:24:23 +03:00

Remove spec v1.3 check for threads (#2354)

* Remove spec v1.3 check for threads

Citation: https://matrix.to/#/!ewdjhNcPcEmYNKzlWp:t2l.io/$CkPuvKdFZyFL547JCy5J3MfvLaWUo_a1XEdmiop1PKc?via=matrix.org&via=element.io&via=envs.net

* Enable stable support always for threads

* Fix tests differently
This commit is contained in:
Travis Ralston
2022-05-09 16:11:04 -06:00
committed by GitHub
parent 706b4d6054
commit 62d77231af
2 changed files with 13 additions and 3 deletions

View File

@ -91,7 +91,12 @@ describe("MatrixClient", function() {
let pendingLookup = null;
function httpReq(cb, method, path, qp, data, prefix) {
if (path === KEEP_ALIVE_PATH && acceptKeepalives) {
return Promise.resolve();
return Promise.resolve({
unstable_features: {
"org.matrix.msc3440.stable": true,
},
versions: ["r0.6.0", "r0.6.1"],
});
}
const next = httpLookups.shift();
const logLine = (

View File

@ -1171,6 +1171,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
const { serverSupport, stable } = await this.doesServerSupportThread();
Thread.setServerSideSupport(serverSupport, stable);
} catch (e) {
// Most likely cause is that `doesServerSupportThread` returned `null` (as it
// is allowed to do) and thus we enter "degraded mode" on threads.
Thread.setServerSideSupport(false, true);
}
@ -6575,14 +6577,17 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
} | null> {
try {
const hasUnstableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440");
const hasStableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable")
|| await this.isVersionSupported("v1.3");
const hasStableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable");
// TODO: Use `this.isVersionSupported("v1.3")` for whatever spec version includes MSC3440 formally.
return {
serverSupport: hasUnstableSupport || hasStableSupport,
stable: hasStableSupport,
};
} catch (e) {
// Assume server support and stability aren't available: null/no data return.
// XXX: This should just return an object with `false` booleans instead.
return null;
}
}