From 6a14cc8f2bf60a60b71a66f1bed37b377263cf0c Mon Sep 17 00:00:00 2001 From: Alex Balgavy Date: Fri, 10 Jul 2026 18:37:57 +0200 Subject: [PATCH 1/2] Bugfix: overriding of parameter/command definitions Currently, if parameters/commands are defined with the same ID, they will be overridden, such that only the latest definition will be saved. This commit adds warnings when parameter/command definitions with existing IDs but differing relative names are received, a warning is printed and the parameter is not added/updated. --- ygw/src/ygw_server.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ygw/src/ygw_server.rs b/ygw/src/ygw_server.rs index d70a5e0..5fce4e4 100644 --- a/ygw/src/ygw_server.rs +++ b/ygw/src/ygw_server.rs @@ -122,7 +122,7 @@ impl Server { /// * One acceptor task for accepting Yamcs connections. /// * One encoder task for encoding messages from nodes and sending them to Yamcs /// * One decoder task for decoding messages from Yamcs and sending them to nodes - /// + /// /// pub async fn start(mut self) -> Result { let mut node_tx_map = HashMap::new(); @@ -396,6 +396,12 @@ async fn encoder_task( YgwMessage::ParameterDefinitions(addr, pdefs) => { if let Some(node) = nodes.get_mut(&addr.node_id()) { for def in pdefs.definitions { + // If there exists a parameter with the same ID but a different relative name, we don't want to override it + if let Some(other_with_same_id) = node.para_defs.definitions.iter().find(|x| x.relative_name != def.relative_name && x.id == def.id) { + log::warn!("Parameter {} with ID {} would override existing parameter {} with same ID, not updating it", def.relative_name, def.id, other_with_same_id.relative_name); + continue; + } + if let Some(pos) = node.para_defs.definitions.iter().position(|x| x.relative_name == def.relative_name) { node.para_defs.definitions[pos] = def; } else { @@ -417,6 +423,12 @@ async fn encoder_task( YgwMessage::CommandDefinitions(addr, cmd_defs) => { if let Some(node) = nodes.get_mut(&addr.node_id()) { for def in cmd_defs.definitions { + // If there exists a command with the same ID but a different relative name, we don't want to override it + if let Some(other_with_same_id) = node.cmd_defs.definitions.iter().find(|x| x.relative_name != def.relative_name && x.ygw_cmd_id == def.ygw_cmd_id) { + log::warn!("Command {} with ID {} would override existing command {} with same ID, not updating it", def.relative_name, def.ygw_cmd_id, other_with_same_id.relative_name); + continue; + } + if let Some(pos) = node.cmd_defs.definitions.iter().position(|x| x.relative_name == def.relative_name) { node.cmd_defs.definitions[pos] = def; } else { From 28136bed95575dd602b40391baa955da1655f904 Mon Sep 17 00:00:00 2001 From: Alex Balgavy Date: Wed, 29 Jul 2026 16:25:33 +0200 Subject: [PATCH 2/2] Bump ygw version --- ygw/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ygw/Cargo.toml b/ygw/Cargo.toml index 804ed83..1a2f916 100644 --- a/ygw/Cargo.toml +++ b/ygw/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ygw" -version = "0.8.0" +version = "0.8.1" edition = "2021" license = "MIT" description = "The goal of Yamcs Gateway is to allow Yamcs to control instruments/payloads as part of an EGSE."