From c160a7c9cacb26ba05916fb16820125c53728d00 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 25 Mar 2020 13:09:42 +0100 Subject: [PATCH] [Room] Ignore errors on requestUser --- lib/src/room.dart | 8 +++----- pubspec.lock | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index 9c309c4..46513d2 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1097,9 +1097,7 @@ class Room { if (states[mxID] != null) { return states[mxID].asUser; } else { - try { - requestUser(mxID); - } catch (_) {} + requestUser(mxID, ignoreErrors: true); return User(mxID, room: this); } } @@ -1108,7 +1106,7 @@ class Room { /// Requests a missing [User] for this room. Important for clients using /// lazy loading. - Future requestUser(String mxID) async { + Future requestUser(String mxID, {bool ignoreErrors = false}) async { if (mxID == null || !_requestingMatrixIds.add(mxID)) return null; Map resp; try { @@ -1117,7 +1115,7 @@ class Room { action: "/client/r0/rooms/$id/state/m.room.member/$mxID"); } catch (exception) { _requestingMatrixIds.remove(mxID); - rethrow; + if (!ignoreErrors) rethrow; } final User user = User(mxID, displayName: resp["displayname"], diff --git a/pubspec.lock b/pubspec.lock index bbc0327..30ef5f6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -196,7 +196,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0+4" + version: "0.12.0+2" http_multi_server: dependency: transitive description: