From 1da4086ed1d582e300cd418e0f088cd1c5fdd95b Mon Sep 17 00:00:00 2001 From: chagai95 <31655082+chagai95@users.noreply.github.com> Date: Wed, 6 Jul 2022 18:20:47 +0300 Subject: [PATCH 1/2] In order to not override the existing well-known we first check to see if there is any data at all --- src/client.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index e612fd27b56..41616bca7f6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -6408,9 +6408,13 @@ export class MatrixClient extends TypedEventEmitter { // `getRawClientConfig` does not throw or reject on network errors, instead // it absorbs errors and returns `{}`. - this.clientWellKnownPromise = AutoDiscovery.getRawClientConfig(this.getDomain()); - this.clientWellKnown = await this.clientWellKnownPromise; - this.emit(ClientEvent.ClientWellKnown, this.clientWellKnown); + // In order to not override the existing well-known we first check to see if there is any data at all + const rawClientConfig = AutoDiscovery.getRawClientConfig(this.getDomain()); + if( Object.keys(rawClientConfig).length !== 0) { + this.clientWellKnownPromise = rawClientConfig; + this.clientWellKnown = await this.clientWellKnownPromise; + this.emit(ClientEvent.ClientWellKnown, this.clientWellKnown); + } } public getClientWellKnown(): IClientWellKnown { From 173b655ee8d9325222979490aed98a38282c581f Mon Sep 17 00:00:00 2001 From: chagai95 <31655082+chagai95@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:52:10 +0300 Subject: [PATCH 2/2] was checking if the promise is empty - now checking the right object --- src/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index 41616bca7f6..d9a6eb2d7bd 100644 --- a/src/client.ts +++ b/src/client.ts @@ -6409,10 +6409,10 @@ export class MatrixClient extends TypedEventEmitter