diff --git a/lib/src/client.dart b/lib/src/client.dart index de0fb683..cd88d55c 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -132,7 +132,7 @@ class Client extends MatrixApi { @override set homeserver(Uri? homeserver) { if (this.homeserver != null && homeserver?.host != this.homeserver?.host) { - _wellKnown = null; + _wellKnown = _getAuthMetadataResponseCache = null; } super.homeserver = homeserver; } @@ -741,6 +741,12 @@ class Client extends MatrixApi { return response; } + GetAuthMetadataResponse? _getAuthMetadataResponseCache; + + @override + Future getAuthMetadata() async => + _getAuthMetadataResponseCache ??= await super.getAuthMetadata(); + /// Sends a logout command to the homeserver and clears all local data, /// including all persistent data from the store. @override