fix tests for real

This commit is contained in:
Sorunome 2020-06-04 18:16:22 +02:00
parent f3f3231df6
commit c94e41d393
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
3 changed files with 4 additions and 7 deletions

View File

@ -179,12 +179,9 @@ class OlmManager {
: null,
oneTimeKeys: signedOneTimeKeys,
);
if (response['signed_curve25519'] != oneTimeKeysCount) {
return false;
}
_olmAccount.mark_keys_as_published();
await client.database?.updateClientKeys(pickledOlmAccount, client.id);
return true;
return response['signed_curve25519'] == oneTimeKeysCount;
}
void handleDeviceOneTimeKeysCount(Map<String, int> countJson) {

View File

@ -159,7 +159,7 @@ void main() {
expect(presenceCounter, 1);
expect(accountDataCounter, 3);
await Future.delayed(Duration(milliseconds: 50));
expect(matrix.userDeviceKeys.length, 3);
expect(matrix.userDeviceKeys.length, 4);
expect(matrix.userDeviceKeys['@alice:example.com'].outdated, false);
expect(matrix.userDeviceKeys['@alice:example.com'].deviceKeys.length, 2);
expect(
@ -178,7 +178,7 @@ void main() {
}
}));
await Future.delayed(Duration(milliseconds: 50));
expect(matrix.userDeviceKeys.length, 2);
expect(matrix.userDeviceKeys.length, 3);
expect(matrix.userDeviceKeys['@alice:example.com'].outdated, true);
await matrix.handleSync(SyncUpdate.fromJson({

View File

@ -1598,7 +1598,7 @@ class FakeMatrixApi extends MockClient {
'/client/r0/keys/upload': (var req) => {
'one_time_key_counts': {
'curve25519': 10,
'signed_curve25519': 66,
'signed_curve25519': json.decode(req)['one_time_keys']?.keys?.length ?? 0,
}
},
'/client/r0/keys/query': (var req) => {