From 0a2b79b62d90376a9b1fd11d77a393a46498c980 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Jan 2019 16:51:30 +0000 Subject: [PATCH 1/4] Error if no sessions decrypted Tell the user if they entered the wrong recovery key Fixes https://github.com/vector-im/riot-web/issues/8143 --- .../views/dialogs/keybackup/RestoreKeyBackupDialog.js | 11 ++++++++++- src/i18n/strings/en_EN.json | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index fba9f0b714..d614168eaa 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -1,5 +1,5 @@ /* -Copyright 2018 New Vector Ltd +Copyright 2018, 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -184,6 +184,15 @@ export default React.createClass({ } else if (this.state.backupInfo === null) { title = _t("Error"); content = _t("No backup found!"); + } else if (this.state.recoverInfo && this.state.recoverInfo.imported === 0) { + title = _t("Error Restoring Backup"); + let failedToDecrypt; + content =
+

{_t( + "Failed to decrypt any sessions: check that the recovery key " + + "used is the correct one for this backup." + )}

+
; } else if (this.state.recoverInfo) { title = _t("Backup Restored"); let failedToDecrypt; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 19c6bf5d28..fd9d9b3eef 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -114,8 +114,6 @@ "Failed to invite": "Failed to invite", "Failed to invite users to the room:": "Failed to invite users to the room:", "Failed to invite the following users to the %(roomName)s room:": "Failed to invite the following users to the %(roomName)s room:", - "Waiting for %(userId)s to accept...": "Waiting for %(userId)s to accept...", - "Waiting for %(userId)s to confirm...": "Waiting for %(userId)s to confirm...", "You need to be logged in.": "You need to be logged in.", "You need to be able to invite users to do that.": "You need to be able to invite users to do that.", "Unable to create widget.": "Unable to create widget.", @@ -1048,6 +1046,8 @@ "Unable to load backup status": "Unable to load backup status", "Unable to restore backup": "Unable to restore backup", "No backup found!": "No backup found!", + "Error Restoring Backup": "Error Restoring Backup", + "Failed to decrypt any sessions: check that the recovery key used is the correct one for this backup.": "Failed to decrypt any sessions: check that the recovery key used is the correct one for this backup.", "Backup Restored": "Backup Restored", "Failed to decrypt %(failedCount)s sessions!": "Failed to decrypt %(failedCount)s sessions!", "Restored %(sessionCount)s session keys": "Restored %(sessionCount)s session keys", From 1a9c3f1ac7b8aeb39a5741bd6eaf535deeedc4b6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Jan 2019 17:41:55 +0000 Subject: [PATCH 2/4] Make error string less technical --- .../views/dialogs/keybackup/RestoreKeyBackupDialog.js | 3 +-- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index d614168eaa..89d41803d5 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -189,8 +189,7 @@ export default React.createClass({ let failedToDecrypt; content =

{_t( - "Failed to decrypt any sessions: check that the recovery key " + - "used is the correct one for this backup." + "Backup restore failed: please verify that you entered the correct recovery key.", )}

; } else if (this.state.recoverInfo) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index fd9d9b3eef..7b701cc863 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1047,7 +1047,7 @@ "Unable to restore backup": "Unable to restore backup", "No backup found!": "No backup found!", "Error Restoring Backup": "Error Restoring Backup", - "Failed to decrypt any sessions: check that the recovery key used is the correct one for this backup.": "Failed to decrypt any sessions: check that the recovery key used is the correct one for this backup.", + "Backup restore failed: please verify that you entered the correct recovery key.": "Backup restore failed: please verify that you entered the correct recovery key.", "Backup Restored": "Backup Restored", "Failed to decrypt %(failedCount)s sessions!": "Failed to decrypt %(failedCount)s sessions!", "Restored %(sessionCount)s session keys": "Restored %(sessionCount)s session keys", From e42b0a9972d870f29a54abe9d0942fc3c9355ae2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Jan 2019 18:02:09 +0000 Subject: [PATCH 3/4] Make error string less redundant --- .../views/dialogs/keybackup/RestoreKeyBackupDialog.js | 3 ++- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index 89d41803d5..d47eca010f 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -189,7 +189,8 @@ export default React.createClass({ let failedToDecrypt; content =

{_t( - "Backup restore failed: please verify that you entered the correct recovery key.", + "Backup could not be decrypted with this key: " + + "please verify that you entered the correct recovery key.", )}

; } else if (this.state.recoverInfo) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7b701cc863..16c40460e2 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1047,7 +1047,7 @@ "Unable to restore backup": "Unable to restore backup", "No backup found!": "No backup found!", "Error Restoring Backup": "Error Restoring Backup", - "Backup restore failed: please verify that you entered the correct recovery key.": "Backup restore failed: please verify that you entered the correct recovery key.", + "Backup could not be decrypted with this key: please verify that you entered the correct recovery key.": "Backup could not be decrypted with this key: please verify that you entered the correct recovery key.", "Backup Restored": "Backup Restored", "Failed to decrypt %(failedCount)s sessions!": "Failed to decrypt %(failedCount)s sessions!", "Restored %(sessionCount)s session keys": "Restored %(sessionCount)s session keys", From 31889ecfad6a92704590309201d6e1867a694f6f Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Jan 2019 19:07:44 +0000 Subject: [PATCH 4/4] Lint --- src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index d47eca010f..fdb4f0a226 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -186,7 +186,6 @@ export default React.createClass({ content = _t("No backup found!"); } else if (this.state.recoverInfo && this.state.recoverInfo.imported === 0) { title = _t("Error Restoring Backup"); - let failedToDecrypt; content =

{_t( "Backup could not be decrypted with this key: " +