Skip to main content

Mountain/RPC/CocoonService/Debug/
StopDebugging.rs

1
2//! Stop an active debug session. Emits `sky://debug/sessionEnd` (NOT
3//! `/stop` - Sky listens on the former at `SkyBridge.ts:2234`;
4//! `DebugProvider.rs:351` emits the same channel from the lifecycle path).
5
6use serde_json::json;
7use tauri::Emitter;
8use tonic::{Response, Status};
9
10use crate::{
11	RPC::CocoonService::CocoonServiceImpl,
12	Vine::Generated::{Empty, StopDebuggingRequest},
13	dev_log,
14};
15
16pub async fn Fn(Service:&CocoonServiceImpl, Request:StopDebuggingRequest) -> Result<Response<Empty>, Status> {
17	dev_log!("cocoon", "[CocoonService] stop_debugging: session={}", Request.session_id);
18
19	let _ = Service
20		.environment
21		.ApplicationHandle
22		.emit("sky://debug/sessionEnd", json!({ "sessionId": Request.session_id }));
23
24	Ok(Response::new(Empty {}))
25}