diff --git a/CHANGELOG.md b/CHANGELOG.md index a26713a7..85e71136 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.3.6] - 30nd Aug 2021 +- hotfix: uiaRequests send broken auth object at first try + ## [0.3.5] - 28nd Aug 2021 - hotfix: Send unencrypted thumbnails diff --git a/lib/src/utils/uia_request.dart b/lib/src/utils/uia_request.dart index ed8f66e8..575b56e0 100644 --- a/lib/src/utils/uia_request.dart +++ b/lib/src/utils/uia_request.dart @@ -59,14 +59,12 @@ class UiaRequest { Future _run([AuthenticationData auth]) async { state = UiaRequestState.loading; try { - auth ??= - AuthenticationData(session: session, type: AuthenticationTypes.token); final res = await request(auth); state = UiaRequestState.done; result = res; return res; } on MatrixException catch (err) { - if (!(err.session is String)) { + if (err.session == null) { rethrow; } session ??= err.session; diff --git a/pubspec.yaml b/pubspec.yaml index 02f2a6e2..b8ada0e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: matrix description: Matrix Dart SDK -version: 0.3.5 +version: 0.3.6 homepage: https://famedly.com environment: diff --git a/test/uia_test.dart b/test/uia_test.dart index aa262890..3d01e6b0 100644 --- a/test/uia_test.dart +++ b/test/uia_test.dart @@ -32,14 +32,16 @@ void main() { var finished = false; final request = UiaRequest( request: (auth) async { - if (auth.session != null && auth.session != 'foxies') { + if (auth != null && + auth.session != null && + auth.session != 'foxies') { throw MatrixException.fromJson({}); } - if (auth.type == 'stage1') { + if (auth != null && auth.type == 'stage1') { if (completed.isEmpty) { completed.add('stage1'); } - } else if (auth.type == 'stage2') { + } else if (auth != null && auth.type == 'stage2') { if (completed.length == 1 && completed[0] == 'stage1') { // okay, we are done! return 'FOXIES ARE FLOOOOOFY!!!!!';