fix(peer-client): plumb peer_id through Satellite talker paths

Satellite{Link,Client}::handleMsgPeerTalkerStart was calling
setTrunkTalkerForTG without recording peer_id, so the
trunkTalkerUpdated signal fired with peer_id="" and the new
peer/<id>/talker/<tg>/start MQTT topic became peer//talker/...
(malformed empty segment).

Use setTrunkTalkerForTGViaPeer with m_satellite_id / m_parent_id
so the topic is properly namespaced.

Also add a defensive early-return in MqttPublisher::onPeerTalker*
that logs a warning and skips the publish if peer_id is empty —
protects against future callers that emit signals without peer
attribution (e.g. TwinLink, addressed in Task 7).
This commit is contained in:
Audric committed 2026-04-28 19:59:32 +02:00
1 parent af746d7534
commit 1bb847b3c8
3 files changed
+16 -2

No files matched your search

+12
View File
@@ -266,6 +266,12 @@ void MqttPublisher::onPeerTalkerStart(const std::string& peer_id,
uint32_t tg,
const std::string& callsign)
{
if (peer_id.empty())
{
geulog::warn("mqtt", "Skipping onPeerTalkerStart with empty peer_id"
" (tg=", tg, " callsign='", callsign, "')");
return;
}
Json::Value payload;
payload["callsign"] = callsign;
payload["tg"] = static_cast<Json::UInt>(tg);
@@ -280,6 +286,12 @@ void MqttPublisher::onPeerTalkerStop(const std::string& peer_id,
uint32_t tg,
const std::string& callsign)
{
if (peer_id.empty())
{
geulog::warn("mqtt", "Skipping onPeerTalkerStop with empty peer_id"
" (tg=", tg, " callsign='", callsign, "')");
return;
}
Json::Value payload;
payload["callsign"] = callsign;
payload["tg"] = static_cast<Json::UInt>(tg);