diff --git a/src/apps.js b/src/apps.js index eae82cdc0..2f60d3697 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1248,6 +1248,8 @@ function update(appId, data, auditSource, callback) { debug(`update: id:${appId}`); + const skipBackup = !!data.skipBackup; + get(appId, function (error, app) { if (error) return callback(error); @@ -1257,17 +1259,13 @@ function update(appId, data, auditSource, callback) { downloadManifest(data.appStoreId, data.manifest, function (error, appStoreId, manifest) { if (error) return callback(error); - var updateConfig = { - skipBackup: !!data.skipBackup - }; - error = manifestFormat.parse(manifest); if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Manifest error:' + error.message)); error = checkManifestConstraints(manifest); if (error) return callback(error); - updateConfig.manifest = manifest; + var updateConfig = { skipBackup, manifest }; // prevent user from installing a app with different manifest id over an existing app // this allows cloudron install -f --app for an app installed from the appStore @@ -1312,7 +1310,7 @@ function update(appId, data, auditSource, callback) { addTask(appId, exports.ISTATE_PENDING_UPDATE, task, function (error, result) { if (error) return callback(error); - eventlog.add(eventlog.ACTION_APP_UPDATE, auditSource, { appId: appId, toManifest: manifest, fromManifest: app.manifest, force: data.force, app: app, taskId: result.taskId }); + eventlog.add(eventlog.ACTION_APP_UPDATE, auditSource, { appId, app, skipBackup, toManifest: manifest, fromManifest: app.manifest, force: data.force, taskId: result.taskId }); // clear update indicator, if update fails, it will come back through the update checker updateChecker.resetAppUpdateInfo(appId);