diff --git a/spec/unit/matrix-client.spec.ts b/spec/unit/matrix-client.spec.ts index 24f9d55e3..d1562d766 100644 --- a/spec/unit/matrix-client.spec.ts +++ b/spec/unit/matrix-client.spec.ts @@ -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 = ( diff --git a/src/client.ts b/src/client.ts index a705f5df5..ecec0ead1 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1171,6 +1171,8 @@ export class MatrixClient extends TypedEventEmitter { 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; } }