From 0dd7f0b8022d83f58d74d68549a715fb36cfaf23 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 31 May 2026 02:48:41 -0700 Subject: [PATCH] fix(runtime): harden mobile QR smoke output (#2417) Harvested from #2415 with thanks to @axobase001. Keeps the denser mobile QR renderer and replaces the fixed binding-warning sleep with health polling plus an explicit timeout failure path, so slow starts fail with the useful cause instead of drifting into misleading assertions. Follow-up to #2403. --- crates/tui/src/runtime_api.rs | 2 +- scripts/mobile-smoke.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/tui/src/runtime_api.rs b/crates/tui/src/runtime_api.rs index 6473ed2d..820e0823 100644 --- a/crates/tui/src/runtime_api.rs +++ b/crates/tui/src/runtime_api.rs @@ -712,7 +712,7 @@ fn print_mobile_urls(addr: SocketAddr, token: Option<&str>, auth_enabled: bool, if show_qr { match qrcode::QrCode::new(qr_url.as_bytes()) { Ok(qr) => { - let qr_str = qr.render::().module_dimensions(2, 1).build(); + let qr_str = qr.render::().build(); println!("\n{qr_str}"); } Err(e) => { diff --git a/scripts/mobile-smoke.sh b/scripts/mobile-smoke.sh index 2b94a898..d333ff5e 100755 --- a/scripts/mobile-smoke.sh +++ b/scripts/mobile-smoke.sh @@ -155,7 +155,20 @@ log "=== Test Group 3: Binding warnings (0.0.0.0 default) ===" STDOUT_FILE=$(mktemp) "$BINARY" serve --port "$PORT" --mobile --insecure > "$STDOUT_FILE" 2>&1 & SERVER_PID=$! -sleep 2 +SERVER_READY=0 +for _ in $(seq 1 30); do + if curl -sf "http://127.0.0.1:${PORT}/health" > /dev/null 2>&1; then + SERVER_READY=1 + break + fi + sleep 0.3 +done +if [[ "$SERVER_READY" -ne 1 ]]; then + rm -f "$STDOUT_FILE" + fail "Server did not become ready on port $PORT" + cleanup + exit 1 +fi STDOUT=$(cat "$STDOUT_FILE") rm -f "$STDOUT_FILE"