Skip to content

Commit 7bbd91f

Browse files
committed
Handle error whilst download key for self
1 parent 3a2a916 commit 7bbd91f

File tree

1 file changed

+7
-2
lines changed
  • matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous

1 file changed

+7
-2
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/rendezvous/Rendezvous.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ class Rendezvous(
150150
val deviceKey = crypto.getMyDevice().fingerprint()
151151
send(Payload(PayloadType.PROGRESS, outcome = Outcome.SUCCESS, deviceId = deviceId, deviceKey = deviceKey))
152152

153-
// explicitly download keys for ourself rather than racing with initial sync which might not complete in time
154-
awaitCallback<MXUsersDevicesMap<CryptoDeviceInfo>> { crypto.downloadKeys(listOf(userId), false, it) }
153+
try {
154+
// explicitly download keys for ourself rather than racing with initial sync which might not complete in time
155+
awaitCallback<MXUsersDevicesMap<CryptoDeviceInfo>> { crypto.downloadKeys(listOf(userId), false, it) }
156+
} catch (e: Throwable) {
157+
// log as warning and continue as initial sync might still complete
158+
Timber.tag(TAG).w(e, "Failed to download keys for self")
159+
}
155160

156161
// await confirmation of verification
157162
val verificationResponse = receive()

0 commit comments

Comments
 (0)