publishing: MQTT works in satellite mode + Redis publishes per-client status blob

- Move MQTT init above the satellite early-return in Reflector::initialize so
  satellite-mode reflectors publish to MQTT (client connect/disconnect, talker
  events, full status, etc.) just like full reflectors.
- Add reflector-sat (SATELLITE_OF=reflector-a) to the default test compose so
  satellite mode is exercised end-to-end. New test_31 verifies MQTT
  client-connect/disconnect events under the satellite's own topic prefix.
- Add RedisStore::pushClientStatus and Reflector::publishClientStatus to write
  the per-client status JSON (qth, rx siglev/sql_open/enabled/active,
  monitoredTGs, selected TG, ...) to live:client:<callsign>.status. Hooked
  from publishRxUpdate, handleNodeInfo, setMonitoredTGs, and setTg.
- New Redis test_live_client_status_blob sends a synthetic MsgNodeInfoV2 with
  qth+rx and asserts the parsed blob contains the expected fields.

31/31 trunk + 10/10 twin + 14/14 redis pass.
This commit is contained in:
Audric committed 2026-04-17 01:05:37 +02:00
1 parent 6b7a1f0306
commit 688a62ec5b
10 files changed
+299 -33

No files matched your search

+15
View File
@@ -314,6 +314,21 @@ void RedisStore::clearLiveClient(const std::string& callsign) {
m_live_queue->push(std::move(op));
}
void RedisStore::pushClientStatus(const std::string& callsign,
const std::string& status_json) {
if (!m_live_queue) return;
RedisLiveQueue::Op op;
op.op = RedisLiveQueue::OpType::HSET;
op.key = keyFor("live:client:" + callsign);
m_live_keys.insert(op.key);
op.fields = {
{"status", status_json},
{"updated_at", std::to_string(std::time(nullptr))}
};
op.ttl_s = 60;
m_live_queue->push(std::move(op));
}
void RedisStore::pushPeerNode(const std::string& peer_id,
const std::string& callsign,
uint32_t tg,