Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More info for "unknown profile version" error message #2361

Merged
merged 6 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ElectronClient/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ class Application extends BaseApplication {
'',
_('Client ID: %s', Setting.value('clientId')),
_('Sync Version: %s', Setting.value('syncVersion')),
_('Profile Version: %s', reg.db().version()),
];
if (gitInfo) {
message.push(`\n${gitInfo}`);
Expand Down
9 changes: 8 additions & 1 deletion ReactNativeClient/lib/joplin-database.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { promiseChain } = require('lib/promise-utils.js');
const { Database } = require('lib/database.js');
const { sprintf } = require('sprintf-js');
const Resource = require('lib/models/Resource');
const { shim } = require('lib/shim.js');

const structureSql = `
CREATE TABLE folders (
Expand Down Expand Up @@ -313,7 +314,13 @@ class JoplinDatabase extends Database {

// currentVersionIndex < 0 if for the case where an old version of Joplin used with a newer
// version of the database, so that migration is not run in this case.
if (currentVersionIndex < 0) throw new Error('Unknown profile version. Most likely this is an old version of Joplin, while the profile was created by a newer version. Please upgrade Joplin at https://joplinapp.org and try again.');
if (currentVersionIndex < 0) {
throw new Error(
'Unknown profile version. Most likely this is an old version of Joplin, while the profile was created by a newer version. Please upgrade Joplin at https://joplinapp.org and try again.\n'
+ `Joplin version: ${shim.appVersion()}\n`
+ `Profile version: ${fromVersion}\n`
+ `Expected version: ${existingDatabaseVersions[existingDatabaseVersions.length-1]}`);
}

if (currentVersionIndex == existingDatabaseVersions.length - 1) return fromVersion;

Expand Down