Previously, if we hit an error in the onEnter function when a user selected an item, we would get stuck completely: the spinner would keep spinning forever. If we hit an error when listing items for a new screen, the error would be displayed but the user wouldn't be able to navigate.
Fix both issues by correctly handling the errors. In both cases, we re-enable the keymap and return the existing model, so the user can continue to navigate.
A glaring example of this issue was if we tried to select a context that was unreachable. We would time out trying to validate the kubeconfig and sit spinning forever. Add a 2 second timeout to the kubeconfig validation to ensure we don't spin for too long, even though we now won't get stuck forever.
[x] Run make reviewable to ensure this PR is ready for review.
[ ] Added backport release-x.y labels to auto-backport this PR, as appropriate.
How has this code been tested
Manual testing with unreachable disconnected spaces and spaces I don't have permission to access. Both cases would previously get stuck, and now don't.
Description of your changes
Previously, if we hit an error in the
onEnter
function when a user selected an item, we would get stuck completely: the spinner would keep spinning forever. If we hit an error when listing items for a new screen, the error would be displayed but the user wouldn't be able to navigate.Fix both issues by correctly handling the errors. In both cases, we re-enable the keymap and return the existing model, so the user can continue to navigate.
A glaring example of this issue was if we tried to select a context that was unreachable. We would time out trying to validate the kubeconfig and sit spinning forever. Add a 2 second timeout to the kubeconfig validation to ensure we don't spin for too long, even though we now won't get stuck forever.
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
Manual testing with unreachable disconnected spaces and spaces I don't have permission to access. Both cases would previously get stuck, and now don't.