diff --git a/src/apps.js b/src/apps.js index ffddc03db..e93c3ac13 100644 --- a/src/apps.js +++ b/src/apps.js @@ -639,11 +639,11 @@ function scheduleTask(appId, installationState, taskId, callback) { // see also apptask makeTaskError boxError.details.taskId = taskId; boxError.details.installationState = installationState; - appdb.update(appId, { installationState: exports.ISTATE_ERROR, error: boxError.toPlainObject(), taskId: null }, callback); + appdb.update(appId, { installationState: exports.ISTATE_ERROR, error: boxError.toPlainObject(), taskId: null }, callback.bind(null, error)); } else if (!(installationState === exports.ISTATE_PENDING_UNINSTALL && !error)) { // clear out taskId except for successful uninstall - appdb.update(appId, { taskId: null }, callback); + appdb.update(appId, { taskId: null }, callback.bind(null, error)); } else { - callback(null); + callback(error); } }); }); @@ -1356,7 +1356,7 @@ function update(app, data, auditSource, callback) { args: { updateConfig }, values, onFinished: (error) => { - eventlog.add(eventlog.ACTION_APP_UPDATE_FINISH, auditSource, { app, success: !error, errorMessage: error ? error.message : null }, () => {}); // ignore error + eventlog.add(eventlog.ACTION_APP_UPDATE_FINISH, auditSource, { app, success: !error, errorMessage: error ? error.message : null }); } }; addTask(appId, exports.ISTATE_PENDING_UPDATE, task, function (error, result) { diff --git a/src/apptask.js b/src/apptask.js index 7aa1ffcd6..fec6ebe7d 100644 --- a/src/apptask.js +++ b/src/apptask.js @@ -523,7 +523,7 @@ function backup(app, args, progressCallback, callback) { if (error) { debugApp(app, 'error backing up app:', error); // return to installed state intentionally. the error is stashed only in the task and not the app (the UI shows error state otherwise) - return updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: null }, callback.bind(null, makeTaskError(error, app))); + return updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: null }, callback.bind(null, error)); } callback(null); }); diff --git a/src/notifications.js b/src/notifications.js index 1d160980e..9a7997929 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -268,6 +268,8 @@ async function onEvent(id, action, source, data) { return await oomEvent(id, data.app, data.addon, data.containerId, data.event); case eventlog.ACTION_APP_UPDATE_FINISH: + if (source.username !== auditSource.CRON.username) return; // updated by user + if (data.errorMessage) return; // the update indicator will still appear, so no need to notify user return await appUpdated(id, data.app); case eventlog.ACTION_CERTIFICATE_RENEWAL: