From 0ebc73ab13711d3abbef613d9a15ba56a3e808d0 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Mon, 25 May 2026 08:02:19 +0400 Subject: [PATCH] fix(android): remove legacy connected event_cb; add preflight_start debug step The legacy event_cb("connected") call between handshake and audio preflight was a no-op on the frontend (it enters voice only after the command resolves) but added noise to failing traces. Replaced with a connect:connected_event_skipped debug event and added an explicit connect:android_audio_preflight_start marker so the debug log shows a clear boundary between handshake completion and audio startup. Co-Authored-By: Claude Sonnet 4.6 --- desktop/src-tauri/src/engine.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/desktop/src-tauri/src/engine.rs b/desktop/src-tauri/src/engine.rs index d500dfe..076ddf3 100644 --- a/desktop/src-tauri/src/engine.rs +++ b/desktop/src-tauri/src/engine.rs @@ -591,12 +591,25 @@ impl CallEngine { "first-join diag: direct P2P — skipping relay handshake (QUIC TLS is the encryption layer)" ); } - event_cb("connected", &format!("joined room {room}")); + // Do not emit the legacy "connected" call-event here. The frontend + // ignores it and enters voice only after the command resolves; on + // Android this synchronous emit was the only operation between + // handshake_done and audio preflight in failing traces. + crate::emit_call_debug( + &app, + "connect:connected_event_skipped", + serde_json::json!({ "t_ms": call_t0.elapsed().as_millis() }), + ); // Oboe audio via the wzp-native cdylib that was dlopen'd at // startup. `wzp_native::audio_start()` brings up the capture + // playout streams; send/recv tasks below pull/push PCM through // the extern "C" bridge rings. + crate::emit_call_debug( + &app, + "connect:android_audio_preflight_start", + serde_json::json!({ "t_ms": call_t0.elapsed().as_millis() }), + ); let native_loaded = crate::wzp_native::is_loaded(); crate::emit_call_debug( &app,