fix: UIA request stucks forever on unexpected matrixExceptions

This commit is contained in:
Krille Fear 2022-02-17 20:54:03 +01:00
parent f967f02487
commit a7f8838522
1 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,9 @@ class UiaRequest<T> {
return res; return res;
} on MatrixException catch (err) { } on MatrixException catch (err) {
if (err.session == null) { if (err.session == null) {
rethrow; error = err;
state = UiaRequestState.fail;
return null;
} }
session ??= err.session; session ??= err.session;
final completed = err.completedAuthenticationFlows; final completed = err.completedAuthenticationFlows;
@ -72,7 +74,9 @@ class UiaRequest<T> {
params = err.authenticationParams ?? <String, dynamic>{}; params = err.authenticationParams ?? <String, dynamic>{};
nextStages = getNextStages(flows, completed); nextStages = getNextStages(flows, completed);
if (nextStages.isEmpty) { if (nextStages.isEmpty) {
rethrow; error = err;
state = UiaRequestState.fail;
return null;
} }
return null; return null;
} catch (err) { } catch (err) {