Move oldManifest out of restoreConfig
This commit is contained in:
18
src/apps.js
18
src/apps.js
@@ -1418,11 +1418,12 @@ function restore(appId, backupId, auditSource, callback) {
|
||||
error = checkManifestConstraints(backupInfo.manifest);
|
||||
if (error) return callback(error);
|
||||
|
||||
const restoreConfig = { backupId, backupFormat: backupInfo.format, oldManifest: app.manifest };
|
||||
const restoreConfig = { backupId, backupFormat: backupInfo.format };
|
||||
|
||||
const task = {
|
||||
args: {
|
||||
restoreConfig,
|
||||
oldManifest: app.manifest,
|
||||
overwriteDns: true
|
||||
},
|
||||
values: {
|
||||
@@ -1469,11 +1470,12 @@ function importApp(appId, data, auditSource, callback) {
|
||||
testBackupConfig(function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
const restoreConfig = { backupId, backupFormat, backupConfig, oldManifest: app.manifest };
|
||||
const restoreConfig = { backupId, backupFormat, backupConfig };
|
||||
|
||||
const task = {
|
||||
args: {
|
||||
restoreConfig,
|
||||
oldManifest: app.manifest,
|
||||
overwriteDns: true
|
||||
},
|
||||
values: {}
|
||||
@@ -1570,9 +1572,9 @@ function clone(appId, data, user, auditSource, callback) {
|
||||
purchaseApp({ appId: newAppId, appstoreId: app.appStoreId, manifestId: manifest.id || 'customapp' }, function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
const restoreConfig = { backupId: backupId, backupFormat: backupInfo.format, oldManifest: null };
|
||||
const restoreConfig = { backupId: backupId, backupFormat: backupInfo.format };
|
||||
const task = {
|
||||
args: { restoreConfig, overwriteDns },
|
||||
args: { restoreConfig, overwriteDns, oldManifest: null },
|
||||
values: {},
|
||||
requiredState: exports.ISTATE_PENDING_CLONE
|
||||
};
|
||||
@@ -1844,17 +1846,19 @@ function restoreInstalledApps(callback) {
|
||||
|
||||
async.eachSeries(apps, function (app, iteratorDone) {
|
||||
backups.getByAppIdPaged(1, 1, app.id, function (error, results) {
|
||||
let installationState, restoreConfig;
|
||||
let installationState, restoreConfig, oldManifest;
|
||||
if (!error && results.length) {
|
||||
installationState = exports.ISTATE_PENDING_RESTORE;
|
||||
restoreConfig = { backupId: results[0].id, backupFormat: results[0].format, oldManifest: app.manifest };
|
||||
restoreConfig = { backupId: results[0].id, backupFormat: results[0].format };
|
||||
oldManifest = app.manifest;
|
||||
} else {
|
||||
installationState = exports.ISTATE_PENDING_INSTALL;
|
||||
restoreConfig = null;
|
||||
oldManifest = null;
|
||||
}
|
||||
|
||||
const task = {
|
||||
args: { restoreConfig, overwriteDns: true },
|
||||
args: { restoreConfig, overwriteDns: true, oldManifest },
|
||||
values: {},
|
||||
scheduleNow: false, // task will be scheduled by autoRestartTasks when platform is ready
|
||||
requireNullTaskId: false // ignore existing stale taskId
|
||||
|
||||
Reference in New Issue
Block a user