diff --git a/src/apps.js b/src/apps.js index 4a5d57afc..bca61124e 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1995,11 +1995,7 @@ async function updateApp(app, data, auditSource) { assert(data.manifest && typeof data.manifest === 'object'); assert.strictEqual(typeof auditSource, 'object'); - const skipBackup = !!data.skipBackup, - appId = app.id, - manifest = data.manifest, - appStoreId = data.appStoreId; - + const skipBackup = !!data.skipBackup, appId = app.id, manifest = data.manifest; const values = {}; if (app.runState === exports.RSTATE_STOPPED) throw new BoxError(BoxError.BAD_STATE, 'Stopped apps cannot be updated'); @@ -2013,7 +2009,8 @@ async function updateApp(app, data, auditSource) { error = await checkManifest(manifest); if (error) throw error; - const updateConfig = { skipBackup, manifest, appStoreId }; // this will clear appStoreId when updating from a repo and set it if passed in for update route + const updateConfig = { skipBackup, manifest }; // this will clear appStoreId when updating from a repo and set it if passed in for update route + if ('appStoreId' in data) updateConfig.appStoreId = data.appStoreId; // 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 diff --git a/src/apptask.js b/src/apptask.js index d587e8b95..a3a779a0a 100644 --- a/src/apptask.js +++ b/src/apptask.js @@ -657,8 +657,6 @@ async function update(app, args, progressCallback) { const values = { manifest: updateConfig.manifest, - appStoreId: updateConfig.appStoreId, - memoryLimit: updateConfig.memoryLimit, portBindings, // all domains have to be updated together subdomain: app.subdomain, @@ -667,6 +665,8 @@ async function update(app, args, progressCallback) { secondaryDomains, redirectDomains: app.redirectDomains }; + if ('memoryLimit' in updateConfig) values.memoryLimit = updateConfig.memoryLimit; + if ('appStoreId' in updateConfig) values.appStoreId = updateConfig.appStoreId; await updateApp(app, values); // switch over to the new config