trunk: ship rich per-client status blob in MsgTrunkNodeList (fixes #3)
Extends type 121 with a parallel string vector carrying each local client's m_status["nodes"][callsign] verbatim. Receivers parse, recursively sanitize (depth/length bounded), and surface the rich blob under /status.trunks[*].nodes (and /status.twin.nodes), MQTT nodes/<peer> and Redis live:peer_node:<peer>:<callsign>.status — bringing partner nodes to parity with local-client status entries (monitoredTGs, restrictedTG, qth, rx/tx config, protoVer, ...). isTalker is derived on the receive side from the live trunk-talker map (MsgTrunkTalkerStart/Stop) rather than carried in the blob, since blob cadence is event-debounced login/logout/TG-change. Lockstep wire bump: peers running an older fork build that knows type 121 with the original 5-vector shape will fail to unpack and silently empty their partner roster until upgraded. Pre-jayReflector peers (no type 121 at all) keep ignoring it as before.
This commit is contained in:
1 parent
69c3c2eea3
commit
a3757ca634
9 files changed
+217
-10
No files matched your search
@@ -1868,6 +1868,21 @@ class TestTrunkIntegration(unittest.TestCase):
|
||||
msg=f"{CLIENT_CALLSIGN} did not appear in {peer}'s "
|
||||
f"/status.trunks.{section}.nodes after login on "
|
||||
f"{self.PRIMARY}")
|
||||
|
||||
# Rich-roster check: the partner-node entry must carry an
|
||||
# isTalker flag derived from the live trunk-talker map
|
||||
# (false here — client is idle). This exercises the wire
|
||||
# extension to MsgTrunkNodeList type 121 and the receive-side
|
||||
# join with TGHandler::trunkTalkerForTG.
|
||||
status = get_status(*_http(peer))
|
||||
trunk = status.get("trunks", {}).get(section, {})
|
||||
entry = next(n for n in trunk.get("nodes", [])
|
||||
if n.get("callsign") == CLIENT_CALLSIGN)
|
||||
self.assertIn("isTalker", entry,
|
||||
"partner-node entry must expose isTalker for parity "
|
||||
"with local-client /status entries")
|
||||
self.assertFalse(entry["isTalker"],
|
||||
"idle client should report isTalker=false")
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
|
||||
Reference in new issue
Block a user