From 2cdeb073531cb884585dc451cd6bc9603734fae6 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:07:58 +0100 Subject: [PATCH] fix(build): show spinner during post_update_to_api to prevent Ctrl+Z abort post_update_to_api can take up to 33 seconds worst-case (3 curl attempts x 10s timeout + sleep delays). Without any terminal output during this time, users think the script is stuck and press Ctrl+Z, which prevents the recovery menu from ever appearing. Add msg_info spinner before both post_update_to_api calls in the failure path (initial report + final force retry after recovery menu). --- misc/build.func | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc/build.func b/misc/build.func index 673d10d24..28b2d3d49 100644 --- a/misc/build.func +++ b/misc/build.func @@ -4173,7 +4173,16 @@ EOF' fi # Report failure to telemetry API (now with log available on host) + # Show spinner so user knows we're still working — post_update_to_api can + # take up to 33 seconds worst-case (3 curl attempts × 10s timeout + sleeps). + # Without feedback, users think the script is stuck and press Ctrl+Z/Ctrl+C. + if declare -f msg_info >/dev/null 2>&1; then + msg_info "Reporting failure to telemetry..." + fi post_update_to_api "failed" "$install_exit_code" + if declare -f stop_spinner >/dev/null 2>&1; then + stop_spinner 2>/dev/null || true + fi # Defense-in-depth: Ensure error handling stays disabled during recovery. # Some functions (e.g. silent/$STD) unconditionally re-enable set -Eeuo pipefail @@ -4537,7 +4546,13 @@ EOF' # Force one final status update attempt after cleanup # This ensures status is updated even if the first attempt failed (e.g., HTTP 400) + if declare -f msg_info >/dev/null 2>&1; then + msg_info "Finalizing telemetry report..." + fi post_update_to_api "failed" "$install_exit_code" "force" + if declare -f stop_spinner >/dev/null 2>&1; then + stop_spinner 2>/dev/null || true + fi exit $install_exit_code fi