notification: app updated message shown despite failure

This commit is contained in:
Girish Ramakrishnan
2021-07-13 13:29:42 -07:00
parent 0947125a03
commit db685d3a56
3 changed files with 7 additions and 5 deletions

View File

@@ -635,11 +635,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);
}
});
});
@@ -1354,7 +1354,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) {