Merge pull request #462 from standardnotes/hotfix/3.3.10
fix: prevent importing backup files with version > 003
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
|||||||
STRING_GENERATING_REGISTER_KEYS,
|
STRING_GENERATING_REGISTER_KEYS,
|
||||||
StringImportError
|
StringImportError
|
||||||
} from '@/strings';
|
} from '@/strings';
|
||||||
|
import { STRING_IMPORT_FAILED_NEWER_BACKUP } from '../../strings';
|
||||||
|
|
||||||
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';
|
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';
|
||||||
|
|
||||||
@@ -345,6 +346,12 @@ class AccountMenuCtrl extends PureCtrl {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const version = data?.auth_params?.version || data?.keyParams?.version;
|
||||||
|
if (!protocolManager.supportedVersions().includes(version)) {
|
||||||
|
this.setState({ importData: null });
|
||||||
|
this.alertManager.alert({ text: STRING_IMPORT_FAILED_NEWER_BACKUP });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (data.auth_params) {
|
if (data.auth_params) {
|
||||||
await this.setState({
|
await this.setState({
|
||||||
importData: {
|
importData: {
|
||||||
|
|||||||
@@ -49,3 +49,5 @@ export function StringImportError({errorCount}) {
|
|||||||
|
|
||||||
/** @password_change */
|
/** @password_change */
|
||||||
export const STRING_FAILED_PASSWORD_CHANGE = "There was an error re-encrypting your items. Your password was changed, but not all your items were properly re-encrypted and synced. You should try syncing again. If all else fails, you should restore your notes from backup.";
|
export const STRING_FAILED_PASSWORD_CHANGE = "There was an error re-encrypting your items. Your password was changed, but not all your items were properly re-encrypted and synced. You should try syncing again. If all else fails, you should restore your notes from backup.";
|
||||||
|
|
||||||
|
export const STRING_IMPORT_FAILED_NEWER_BACKUP = "This backup file was created using a newer version of the application and cannot be imported here. Please update your application and try again.";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "3.3.6",
|
"version": "3.3.10",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
"start": "webpack-dev-server --progress",
|
"start": "webpack-dev-server --progress",
|
||||||
"bundle": "webpack --mode production",
|
"bundle": "webpack --mode production",
|
||||||
"precompile:assets": "bundle exec rails assets:precompile",
|
"precompile:assets": "bundle exec rails assets:precompile",
|
||||||
"postinstall": "npm run precompile:assets",
|
|
||||||
"build": "bundle install && npm ci && npm run precompile:assets && npm run bundle",
|
"build": "bundle install && npm ci && npm run precompile:assets && npm run bundle",
|
||||||
"submodules": "git submodule update --init --force --remote",
|
"submodules": "git submodule update --init --force --remote",
|
||||||
"test": "karma start karma.conf.js --single-run",
|
"test": "karma start karma.conf.js --single-run",
|
||||||
|
|||||||
Reference in New Issue
Block a user