(cherry picked from commit ff75ab1faa9d01f92b6740f057b17020c0c5b32b)
handleSuccessViewState
handleFailureViewState