Merge pull request #4371 from matrix-org/dbkr/retry_master_key_fetch
Retry the request for the master key from SSSS on loginpull/21833/head
commit
928d4acd31
|
@ -1907,13 +1907,19 @@ export default createReactClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for the master cross-signing key in SSSS as a quick proxy for
|
// Test for the master cross-signing key in SSSS as a quick proxy for
|
||||||
// whether cross-signing has been set up on the account.
|
// whether cross-signing has been set up on the account. We can't
|
||||||
let masterKeyInStorage = false;
|
// really continue until we know whether it's there or not so retry
|
||||||
|
// if this fails.
|
||||||
|
let masterKeyInStorage;
|
||||||
|
while (masterKeyInStorage === undefined) {
|
||||||
try {
|
try {
|
||||||
masterKeyInStorage = !!await cli.getAccountDataFromServer("m.cross_signing.master");
|
masterKeyInStorage = !!await cli.getAccountDataFromServer("m.cross_signing.master");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.errcode !== "M_NOT_FOUND") {
|
if (e.errcode === "M_NOT_FOUND") {
|
||||||
console.warn("Secret storage account data check failed", e);
|
masterKeyInStorage = false;
|
||||||
|
} else {
|
||||||
|
console.warn("Secret storage account data check failed: retrying...", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue