debugger: Handle session restart failures instead of hanging (#32595)

I also enabled the `Restart` action even for sessions that don't support
restarting because we have a restart fallback now.

Closes #31408

Release Notes:

- Fix bug where a debugger session would never be shutdown on a failed
restart attempt
This commit is contained in:
Anthony Eid 2025-06-12 04:29:34 -04:00 committed by GitHub
parent d1ca6db756
commit 4e4856f2c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 6 deletions

View file

@ -349,8 +349,26 @@ impl DebugPanel {
});
(session, task)
})?;
Self::register_session(this.clone(), session, true, cx).await?;
task.await
Self::register_session(this.clone(), session.clone(), true, cx).await?;
if let Err(error) = task.await {
session
.update(cx, |session, cx| {
session
.console_output(cx)
.unbounded_send(format!(
"Session failed to restart with error: {}",
error
))
.ok();
session.shutdown(cx)
})?
.await;
return Err(error);
};
Ok(())
})
.detach_and_log_err(cx);
}