diff --git a/dashboard/src/components/app/Updates.vue b/dashboard/src/components/app/Updates.vue index 3ee3497e4..508f8d9ca 100644 --- a/dashboard/src/components/app/Updates.vue +++ b/dashboard/src/components/app/Updates.vue @@ -78,7 +78,7 @@ async function onUpdate() { const [error, result] = await appsModel.update(props.app.id, appData, skipBackup.value); if (error) { busyUpdate.value = false; - if (error.status === 400) updateError.value = error.body ? error.body.message : 'Internal error'; + if (error.status !== 202) updateError.value = error.body ? error.body.message : 'Internal error'; return console.error(error); } @@ -89,6 +89,8 @@ async function onUpdate() { function onAskUpdate() { busyUpdate.value = false; + updateError.value = ''; + dialog.value.open(); } @@ -121,6 +123,7 @@ onMounted(async () => {
{{ $t('app.updateDialog.changelogHeader', { version: app.updateInfo.manifest.version }) }}
+
{{ updateError }}
@@ -151,7 +154,6 @@ onMounted(async () => {
{{ $t('app.updateDialog.subscriptionExpired') }}
-
{{ updateError }}
{{ $t('app.updateDialog.unstableWarning') }}

diff --git a/src/apps.js b/src/apps.js index 2eb9d1751..f943ceaec 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2327,6 +2327,11 @@ async function updateApp(app, data, auditSource) { error = await checkManifest(manifest); if (error) throw error; + if (!skipBackup) { + const sites = await backupSites.listByContentForUpdates(app.id); + if (sites.length === 0) throw new BoxError(BoxError.BAD_STATE, 'App has no backup site for updates'); + } + const updateConfig = { skipBackup, manifest }; // this will clear appStoreId/versionsUrl when updating from a repo and set it if passed in for update route if ('appStoreId' in data) updateConfig.appStoreId = data.appStoreId; if ('versionsUrl' in data) updateConfig.versionsUrl = data.versionsUrl;