From 8b397f807f06b20d37cea0c6f7aa1a8c55c80795 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 22 Apr 2020 14:45:50 +0100 Subject: [PATCH] Skip auth flow test for signing upload when password present If we already have an account password to use during secret storage setup, then it's highly likely that the homeserver accepts passwords for device signing key upload as well. This change then assumes password auth will work without checking to avoid a request when the server is under high load. Fixes https://github.com/vector-im/riot-web/issues/13286 --- .../dialogs/secretstorage/CreateSecretStorageDialog.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index cf7f4d4126..d64a2247a2 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -92,7 +92,15 @@ export default class CreateSecretStorageDialog extends React.PureComponent { }; this._fetchBackupInfo(); - this._queryKeyUploadAuth(); + if (this.state.accountPassword) { + // If we have an account password in memory, let's simplify and + // assume it means password auth is also supported for device + // signing key upload as well. This avoids hitting the server to + // test auth flows, which may be slow under high load. + this.state.canUploadKeysWithPasswordOnly = true; + } else { + this._queryKeyUploadAuth(); + } MatrixClientPeg.get().on('crypto.keyBackupStatus', this._onKeyBackupStatusChange); }