notification: app updated message shown despite failure

(cherry picked from commit db685d3a56)
This commit is contained in:
Girish Ramakrishnan
2021-07-13 13:29:42 -07:00
parent 0befba6648
commit 2f98ac3e92
3 changed files with 7 additions and 5 deletions

View File

@@ -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) {