mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Log errors
This commit is contained in:
parent
1d5ed46a49
commit
ed0143c240
1 changed files with 4 additions and 4 deletions
|
@ -80,7 +80,7 @@ internal class OneTimeKeysUploader @Inject constructor(
|
|||
val keyLimit = floor(maxOneTimeKeys / 2.0).toInt()
|
||||
if (oneTimeKeyCount == null) {
|
||||
// Ask the server how many otk he has
|
||||
oneTimeKeyCount = fetchOtkNumber()
|
||||
oneTimeKeyCount = fetchOtkCount()
|
||||
}
|
||||
val oneTimeKeyCountFromSync = oneTimeKeyCount
|
||||
if (oneTimeKeyCountFromSync != null) {
|
||||
|
@ -95,7 +95,7 @@ internal class OneTimeKeysUploader @Inject constructor(
|
|||
// private keys clogging up our local storage.
|
||||
// So we need some kind of engineering compromise to balance all of
|
||||
// these factors.
|
||||
tryOrNull {
|
||||
tryOrNull("Unable to upload OTK") {
|
||||
val uploadedKeys = uploadOTK(oneTimeKeyCountFromSync, keyLimit)
|
||||
Timber.v("## uploadKeys() : success, $uploadedKeys key(s) sent")
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ internal class OneTimeKeysUploader @Inject constructor(
|
|||
oneTimeKeyCheckInProgress = false
|
||||
}
|
||||
|
||||
private suspend fun fetchOtkNumber(): Int? {
|
||||
return tryOrNull {
|
||||
private suspend fun fetchOtkCount(): Int? {
|
||||
return tryOrNull("Unable to get OTK count") {
|
||||
val result = uploadKeysTask.execute(UploadKeysTask.Params(null, null))
|
||||
result.oneTimeKeyCountsForAlgorithm(MXKey.KEY_SIGNED_CURVE_25519_TYPE)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue