You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-06 12:02:40 +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:
@@ -91,7 +91,12 @@ describe("MatrixClient", function() {
|
|||||||
let pendingLookup = null;
|
let pendingLookup = null;
|
||||||
function httpReq(cb, method, path, qp, data, prefix) {
|
function httpReq(cb, method, path, qp, data, prefix) {
|
||||||
if (path === KEEP_ALIVE_PATH && acceptKeepalives) {
|
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 next = httpLookups.shift();
|
||||||
const logLine = (
|
const logLine = (
|
||||||
|
@@ -1171,6 +1171,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
const { serverSupport, stable } = await this.doesServerSupportThread();
|
const { serverSupport, stable } = await this.doesServerSupportThread();
|
||||||
Thread.setServerSideSupport(serverSupport, stable);
|
Thread.setServerSideSupport(serverSupport, stable);
|
||||||
} catch (e) {
|
} 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);
|
Thread.setServerSideSupport(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6575,14 +6577,17 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
} | null> {
|
} | null> {
|
||||||
try {
|
try {
|
||||||
const hasUnstableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440");
|
const hasUnstableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440");
|
||||||
const hasStableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable")
|
const hasStableSupport = await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable");
|
||||||
|| await this.isVersionSupported("v1.3");
|
|
||||||
|
// TODO: Use `this.isVersionSupported("v1.3")` for whatever spec version includes MSC3440 formally.
|
||||||
|
|
||||||
return {
|
return {
|
||||||
serverSupport: hasUnstableSupport || hasStableSupport,
|
serverSupport: hasUnstableSupport || hasStableSupport,
|
||||||
stable: hasStableSupport,
|
stable: hasStableSupport,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} 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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user