From 65c210cdde9573646ec0d8a1f512953a5db0915f Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Dec 2017 15:28:20 +0000 Subject: [PATCH 1/4] Warn when migrating e2e data to indexeddb --- src/components/structures/MatrixChat.js | 29 +++++++++++++++++++++++++ src/i18n/strings/en_EN.json | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index cd75ad8798..77ed5d7800 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1142,6 +1142,35 @@ module.exports = React.createClass({ room.setBlacklistUnverifiedDevices(blacklistEnabled); } }); + cli.on("crypto.warning", (type) => { + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + switch (type) { + case 'CRYPTO_WARNING_ACCOUNT_MIGRATED': + Modal.createTrackedDialog('Crypto migrated', '', ErrorDialog, { + title: _t('Cryptography data migrated'), + description: _t( + "A one-off migration of cryptography data has been performed. "+ + "End-to-end encryption will not work if you go back to an older "+ + "version of Riot. If you need to use end-to-end cryptography on "+ + "an older version, log out of Riot first. To retain message history "+ + "export and re-import your keys." + ), + }); + break; + case 'CRYPTO_WARNING_OLD_VERSION_DETECTED': + Modal.createTrackedDialog('Crypto migrated', '', ErrorDialog, { + title: _t('Old cryptography data detected'), + description: _t( + "Data from an older version of Riot has been detected. "+ + "This will have caused end-to-end cryptography to malfunction "+ + "in the older version. End-to-end encrypted messages exchanged "+ + "recently whilst using the older version may not be decryptable "+ + "in this version." + ), + }); + break; + } + }); }, /** diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index d632692e04..9169b4bae7 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -748,6 +748,10 @@ "Failed to leave room": "Failed to leave room", "Signed Out": "Signed Out", "For security, this session has been signed out. Please sign in again.": "For security, this session has been signed out. Please sign in again.", + "Cryptography data migrated": "Cryptography data migrated", + "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history export and re-import your keys.": "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history export and re-import your keys.", + "Old cryptography data detected": "Old cryptography data detected", + "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version.": "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version.", "Logout": "Logout", "Your Communities": "Your Communities", "Error whilst fetching joined communities": "Error whilst fetching joined communities", From 446269443855d2d978ea51ca87effe9ccba4d102 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Dec 2017 16:06:33 +0000 Subject: [PATCH 2/4] lint --- src/components/structures/MatrixChat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 77ed5d7800..d78f1f0495 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1153,7 +1153,7 @@ module.exports = React.createClass({ "End-to-end encryption will not work if you go back to an older "+ "version of Riot. If you need to use end-to-end cryptography on "+ "an older version, log out of Riot first. To retain message history "+ - "export and re-import your keys." + "export and re-import your keys.", ), }); break; @@ -1165,7 +1165,7 @@ module.exports = React.createClass({ "This will have caused end-to-end cryptography to malfunction "+ "in the older version. End-to-end encrypted messages exchanged "+ "recently whilst using the older version may not be decryptable "+ - "in this version." + "in this version.", ), }); break; From aa99b898ceff2b91629ece7b1d00cffa9e96b4b8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Dec 2017 18:57:48 +0000 Subject: [PATCH 3/4] Add that it might not work now either also a comma --- src/components/structures/MatrixChat.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index d78f1f0495..6c192564b2 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1152,7 +1152,7 @@ module.exports = React.createClass({ "A one-off migration of cryptography data has been performed. "+ "End-to-end encryption will not work if you go back to an older "+ "version of Riot. If you need to use end-to-end cryptography on "+ - "an older version, log out of Riot first. To retain message history "+ + "an older version, log out of Riot first. To retain message history, "+ "export and re-import your keys.", ), }); @@ -1165,7 +1165,9 @@ module.exports = React.createClass({ "This will have caused end-to-end cryptography to malfunction "+ "in the older version. End-to-end encrypted messages exchanged "+ "recently whilst using the older version may not be decryptable "+ - "in this version.", + "in this version. This may also cause messages exchanged with this "+ + "version to fail. If you experience problems, log out and back in "+ + "again. To retain message history, export and re-import your keys.", ), }); break; From ab2fcfb388cbc5db5396b3e44d5f7aeb12149587 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Dec 2017 16:36:30 +0000 Subject: [PATCH 4/4] re-run the fun^w^wnpm run i18n --- src/i18n/strings/en_EN.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 9169b4bae7..ad72277956 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -749,9 +749,9 @@ "Signed Out": "Signed Out", "For security, this session has been signed out. Please sign in again.": "For security, this session has been signed out. Please sign in again.", "Cryptography data migrated": "Cryptography data migrated", - "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history export and re-import your keys.": "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history export and re-import your keys.", + "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history, export and re-import your keys.": "A one-off migration of cryptography data has been performed. End-to-end encryption will not work if you go back to an older version of Riot. If you need to use end-to-end cryptography on an older version, log out of Riot first. To retain message history, export and re-import your keys.", "Old cryptography data detected": "Old cryptography data detected", - "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version.": "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version.", + "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.": "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.", "Logout": "Logout", "Your Communities": "Your Communities", "Error whilst fetching joined communities": "Error whilst fetching joined communities",