fix: by default don't uplaod new keys in our tests

This reduces CPU load of the uploadKeys callback by a lot, since we
don't upload new keys on every empty sync in the tests.
This commit is contained in:
Nicolas Werner 2024-10-07 19:03:33 +02:00
parent b74dbdea4a
commit 583be5ece7
No known key found for this signature in database
GPG Key ID: B38119FF80087618
1 changed files with 8 additions and 2 deletions

View File

@ -204,7 +204,13 @@ class FakeMatrixApi extends BaseClient {
await Future.delayed(Duration(milliseconds: 50));
}
res = {
'next_batch': DateTime.now().millisecondsSinceEpoch.toString(),
// So that it is clear which sync we are processing prefix it with 'empty_'
'next_batch': 'empty_${DateTime.now().millisecondsSinceEpoch}',
// ensure we don't generate new keys for no reason
'device_one_time_keys_count': {
'curve25519': 10,
'signed_curve25519': 100
},
};
} else if (method == 'PUT' &&
_client != null &&
@ -1038,7 +1044,7 @@ class FakeMatrixApi extends BaseClient {
'@bob:example.com',
],
},
'device_one_time_keys_count': {'curve25519': 10, 'signed_curve25519': 20},
'device_one_time_keys_count': {'curve25519': 10, 'signed_curve25519': 100},
};
static Map<String, dynamic> archiveSyncResponse = {