feat(appd): broadcast AppState::Stopped when supervised process exits

runtime.rs: after the child exits (natural exit or abort), supervise()
now broadcasts AppState { session_id, state: Stopped } in the same
lock scope as set_state. WebSocket clients receive the notification
without needing to poll QueryAppState or call TerminateApp.
This commit is contained in:
Marco Allegretti 2026-03-11 11:16:28 +01:00
parent 68e1f82ca7
commit 3315b158db

View file

@ -75,10 +75,14 @@ pub(crate) async fn supervise(
} }
} }
registry {
.lock() let mut reg = registry.lock().await;
.await reg.set_state(session_id, AppStateKind::Stopped);
.set_state(session_id, AppStateKind::Stopped); let _ = reg.broadcast().send(Response::AppState {
session_id,
state: AppStateKind::Stopped,
});
}
Ok(()) Ok(())
} }