From dbe44bd0e080292a3eb4b9e74f259ec0c9c4a20a Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 11 Mar 2026 10:50:41 +0100 Subject: [PATCH] feat(appd): include app_id in AppReady broadcast ipc.rs: AppReady { session_id, app_id: String }. runtime.rs: supervise() passes app_id (already in scope as parameter) when building the AppReady broadcast message. main.rs: supervisor integration test updated to use .. to ignore app_id in the AppReady pattern match. --- crates/weft-appd/src/ipc.rs | 1 + crates/weft-appd/src/main.rs | 2 +- crates/weft-appd/src/runtime.rs | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/weft-appd/src/ipc.rs b/crates/weft-appd/src/ipc.rs index b22b42e..8b268a3 100644 --- a/crates/weft-appd/src/ipc.rs +++ b/crates/weft-appd/src/ipc.rs @@ -25,6 +25,7 @@ pub enum Response { }, AppReady { session_id: u64, + app_id: String, }, RunningApps { sessions: Vec, diff --git a/crates/weft-appd/src/main.rs b/crates/weft-appd/src/main.rs index 6df35cd..186b3f4 100644 --- a/crates/weft-appd/src/main.rs +++ b/crates/weft-appd/src/main.rs @@ -449,7 +449,7 @@ mod tests { let notification = rx.try_recv(); assert!(matches!( notification, - Ok(Response::AppReady { session_id: sid }) if sid == session_id + Ok(Response::AppReady { session_id: sid, .. }) if sid == session_id )); let _ = std::fs::remove_file(&script); diff --git a/crates/weft-appd/src/runtime.rs b/crates/weft-appd/src/runtime.rs index 6121b71..1b9335a 100644 --- a/crates/weft-appd/src/runtime.rs +++ b/crates/weft-appd/src/runtime.rs @@ -42,11 +42,10 @@ pub(crate) async fn supervise( .lock() .await .set_state(session_id, AppStateKind::Running); - let _ = registry - .lock() - .await - .broadcast() - .send(Response::AppReady { session_id }); + let _ = registry.lock().await.broadcast().send(Response::AppReady { + session_id, + app_id: app_id.to_owned(), + }); tracing::info!(session_id, %app_id, "app ready"); } Ok(Err(e)) => {