From d4c9522da786856caf2267d5c78d1d1d36bf2d56 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 17 Jun 2025 12:36:46 +0200 Subject: [PATCH] debugger: Do not query threads when session is still building (#32852) This should silence a noisy log we see whenever a debug session is started: `2025-06-17T12:06:12+02:00 ERROR [project] no adapter running to send request: ThreadsCommand` Closes #ISSUE Release Notes: - Fixed debugger logs getting clobbered with internal logs about Threads Command whenever a new debug session is created. --- crates/debugger_ui/src/debugger_panel.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs index 6e8fcdb2aa6fe53b73164e731562132d7cc325f8..bea3b396576376c6e443a52e3d8b7c18fb4a5211 100644 --- a/crates/debugger_ui/src/debugger_panel.rs +++ b/crates/debugger_ui/src/debugger_panel.rs @@ -858,16 +858,21 @@ impl DebugPanel { let threads = running_state.update(cx, |running_state, cx| { let session = running_state.session(); - session - .update(cx, |session, cx| session.threads(cx)) + session.read(cx).is_running().then(|| { + session.update(cx, |session, cx| { + session.threads(cx) + }) + }) }); - self.render_thread_dropdown( - &running_state, - threads, - window, - cx, - ) + threads.and_then(|threads| { + self.render_thread_dropdown( + &running_state, + threads, + window, + cx, + ) + }) }) .when(!is_side, |this| this.gap_2().child(Divider::vertical())) },