Allow uninstall in error state

This commit is contained in:
Girish Ramakrishnan
2019-09-23 10:35:42 -07:00
parent 78e9446a05
commit bf122f0f56
2 changed files with 4 additions and 2 deletions

View File

@@ -667,7 +667,9 @@ function checkAppState(app, state) {
if (app.taskId) return new AppsError(AppsError.BAD_STATE, `Not allowed in this app state : ${app.installationState} / ${app.runState}`);
if (state !== exports.ISTATE_PENDING_REPAIR && app.installationState === exports.ISTATE_ERROR) return new AppsError(AppsError.BAD_STATE, 'Not allowed in error state');
if (app.installationState === exports.ISTATE_ERROR) {
if (state !== exports.ISTATE_PENDING_REPAIR && state !== exports.ISTATE_PENDING_UNINSTALL) return new AppsError(AppsError.BAD_STATE, 'Not allowed in error state');
}
return null;
}