From a7f883852253d3bc89a350c19f3122ee35f00343 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Thu, 17 Feb 2022 20:54:03 +0100 Subject: [PATCH] fix: UIA request stucks forever on unexpected matrixExceptions --- lib/src/utils/uia_request.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/utils/uia_request.dart b/lib/src/utils/uia_request.dart index 65511d0f..174cc106 100644 --- a/lib/src/utils/uia_request.dart +++ b/lib/src/utils/uia_request.dart @@ -64,7 +64,9 @@ class UiaRequest { return res; } on MatrixException catch (err) { if (err.session == null) { - rethrow; + error = err; + state = UiaRequestState.fail; + return null; } session ??= err.session; final completed = err.completedAuthenticationFlows; @@ -72,7 +74,9 @@ class UiaRequest { params = err.authenticationParams ?? {}; nextStages = getNextStages(flows, completed); if (nextStages.isEmpty) { - rethrow; + error = err; + state = UiaRequestState.fail; + return null; } return null; } catch (err) {