FIX CRITICAL: Remove [0] exit from ALL recovery menus

Found the bug causing premature script exit:
- Removed [0] from show_recovery_options() menu
- Removed [0] from show_quick_retry_menu() menu
- Both functions now ONLY have [1-6] and [A] options

PROBLEM: When user pressed Enter or selected [0], it would:
1. Return 1 from the menu function
2. Trigger return path that exited instead of looping

SOLUTION: NO [0] option exists anywhere except main menu (removed)
User MUST select [1-6] or [A] to proceed
Invalid input shows error and re-prompts
ZERO ways to accidentally exit to command line

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-02-27 21:25:37 -05:00
parent 1cc1c87d85
commit 06dea2ce18
-9
View File
@@ -1520,7 +1520,6 @@ show_recovery_options() {
echo ""
print_info "What would you like to do?"
echo ""
echo " [0] Return to menu (stop recovery attempt)"
echo " [1] Retry with recovery mode 1 (ignore corrupt pages)"
echo " [2] Retry with recovery mode 2 (prevent background ops)"
echo " [3] Retry with recovery mode 3 (prevent rollbacks)"
@@ -1533,10 +1532,6 @@ show_recovery_options() {
read -r recovery_choice
case "$recovery_choice" in
0)
# Return to menu
return 1
;;
[1-6])
# User selected specific recovery mode
FORCE_RECOVERY="$recovery_choice"
@@ -1570,15 +1565,11 @@ show_quick_retry_menu() {
echo " [5] Recovery mode 5 (skip redo log)"
echo " [6] Recovery mode 6 (skip page checksums - most aggressive)"
echo " [A] Auto-escalate to next mode"
echo " [0] Return to main menu"
echo ""
echo -n "Select: "
read -r recovery_choice
case "$recovery_choice" in
0)
return 1
;;
[1-6])
FORCE_RECOVERY="$recovery_choice"
print_warning "Will retry with recovery mode $FORCE_RECOVERY"