Handle error whilst download key for self

This commit is contained in:
Hugh Nimmo-Smith 2022-12-07 15:09:43 +00:00
parent 3a2a916c2f
commit 7bbd91f2a9
1 changed files with 7 additions and 2 deletions

View File

@ -150,8 +150,13 @@ class Rendezvous(
val deviceKey = crypto.getMyDevice().fingerprint()
send(Payload(PayloadType.PROGRESS, outcome = Outcome.SUCCESS, deviceId = deviceId, deviceKey = deviceKey))
// explicitly download keys for ourself rather than racing with initial sync which might not complete in time
awaitCallback<MXUsersDevicesMap<CryptoDeviceInfo>> { crypto.downloadKeys(listOf(userId), false, it) }
try {
// explicitly download keys for ourself rather than racing with initial sync which might not complete in time
awaitCallback<MXUsersDevicesMap<CryptoDeviceInfo>> { crypto.downloadKeys(listOf(userId), false, it) }
} catch (e: Throwable) {
// log as warning and continue as initial sync might still complete
Timber.tag(TAG).w(e, "Failed to download keys for self")
}
// await confirmation of verification
val verificationResponse = receive()