You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Retry the request for the master key from SSSS on login
If this failed we assumed it didn't exist which would erroneously prompt people to upgrade encryption.
This commit is contained in:
@ -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
|
||||||
try {
|
// if this fails.
|
||||||
masterKeyInStorage = !!await cli.getAccountDataFromServer("m.cross_signing.master");
|
let masterKeyInStorage;
|
||||||
} catch (e) {
|
while (masterKeyInStorage === undefined) {
|
||||||
if (e.errcode !== "M_NOT_FOUND") {
|
try {
|
||||||
console.warn("Secret storage account data check failed", e);
|
masterKeyInStorage = !!await cli.getAccountDataFromServer("m.cross_signing.master");
|
||||||
|
} catch (e) {
|
||||||
|
if (e.errcode === "M_NOT_FOUND") {
|
||||||
|
masterKeyInStorage = false;
|
||||||
|
} else {
|
||||||
|
console.warn("Secret storage account data check failed: retrying...", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user