Merge branch 'krille/fix-background-uia' into 'main'

fix: UIA request stucks forever on unexpected matrixExceptions

See merge request famedly/company/frontend/famedlysdk!966
This commit is contained in:
Krille Fear 2022-02-19 11:32:40 +00:00
commit 215de3b948
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) {