fix: uiaRequests send broken auth object at first try

We should just let the `auth` object null and dont send it at the
first try and wait for the servers response. This worked in the past
but now it is broken because of changes in the
matrix_api_lite. This could also be fault for some
bootstrap issues.
I have also removed an unnecessary check if a String is a String and just made it a
null check because this was intended at this point.

Because of that this blocks uiaRequests it is a hotfix and therefore directly bumps the version.
This commit is contained in:
Christian Pauly 2021-08-30 08:27:18 +02:00
parent ffb6fd426c
commit 4bee82dbe0
4 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -59,14 +59,12 @@ class UiaRequest<T> {
Future<T> _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;

View File

@ -1,6 +1,6 @@
name: matrix
description: Matrix Dart SDK
version: 0.3.5
version: 0.3.6
homepage: https://famedly.com
environment:

View File

@ -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(<String, dynamic>{});
}
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!!!!!';