Merge pull request #7699 from vector-im/bugfix/hughns/qr-device-race
This commit is contained in:
commit
a762179c32
|
@ -0,0 +1 @@
|
||||||
|
Fix E2EE set up failure whilst signing in using QR code
|
|
@ -35,7 +35,10 @@ import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_S
|
||||||
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
|
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
|
||||||
import org.matrix.android.sdk.api.session.crypto.crosssigning.SELF_SIGNING_KEY_SSSS_NAME
|
import org.matrix.android.sdk.api.session.crypto.crosssigning.SELF_SIGNING_KEY_SSSS_NAME
|
||||||
import org.matrix.android.sdk.api.session.crypto.crosssigning.USER_SIGNING_KEY_SSSS_NAME
|
import org.matrix.android.sdk.api.session.crypto.crosssigning.USER_SIGNING_KEY_SSSS_NAME
|
||||||
|
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
|
||||||
|
import org.matrix.android.sdk.api.session.crypto.model.MXUsersDevicesMap
|
||||||
import org.matrix.android.sdk.api.util.MatrixJsonParser
|
import org.matrix.android.sdk.api.util.MatrixJsonParser
|
||||||
|
import org.matrix.android.sdk.api.util.awaitCallback
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,6 +150,14 @@ class Rendezvous(
|
||||||
val deviceKey = crypto.getMyDevice().fingerprint()
|
val deviceKey = crypto.getMyDevice().fingerprint()
|
||||||
send(Payload(PayloadType.PROGRESS, outcome = Outcome.SUCCESS, deviceId = deviceId, deviceKey = deviceKey))
|
send(Payload(PayloadType.PROGRESS, outcome = Outcome.SUCCESS, deviceId = deviceId, deviceKey = deviceKey))
|
||||||
|
|
||||||
|
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
|
// await confirmation of verification
|
||||||
val verificationResponse = receive()
|
val verificationResponse = receive()
|
||||||
if (verificationResponse?.outcome == Outcome.VERIFIED) {
|
if (verificationResponse?.outcome == Outcome.VERIFIED) {
|
||||||
|
|
Loading…
Reference in New Issue