app update: if backup fails, provide a notification

fixes #851
This commit is contained in:
Girish Ramakrishnan
2026-03-14 22:56:14 +05:30
parent 0079162efe
commit 8f1f3645b2
9 changed files with 87 additions and 13 deletions
+3 -2
View File
@@ -1063,8 +1063,9 @@ async function onTaskFinished(error, appId, installationState, taskId, auditSour
case ISTATE_PENDING_UPDATE: {
const fromManifest = success ? task.args[1].updateConfig.manifest : app.manifest;
const toManifest = success ? app.manifest : task.args[1].updateConfig.manifest;
const backupError = error?.backupError || false;
await eventlog.add(eventlog.ACTION_APP_UPDATE_FINISH, auditSource, { app, toManifest, fromManifest, success, errorMessage });
await eventlog.add(eventlog.ACTION_APP_UPDATE_FINISH, auditSource, { app, toManifest, fromManifest, success, errorMessage, backupError });
await notifications.unpin(notifications.TYPE_MANUAL_APP_UPDATE_NEEDED, { context: app.id });
break;
}
@@ -2333,7 +2334,7 @@ async function updateApp(app, data, auditSource) {
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');
if (sites.length === 0) throw new BoxError(BoxError.BAD_STATE, 'App has no backup site for updates', { backupError: true });
}
const updateConfig = { skipBackup, manifest }; // this will clear appStoreId/versionsUrl when updating from a repo and set it if passed in for update route