feat: handle NODE_STATUS_APP packets to populate node status string

Parse UTF-8 payload from NODE_STATUS_APP (PortNum=36) and update
the node's nodeStatus field. Already displayed in NodeItem and
NodeDetailsSection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich
2026-05-06 14:15:01 -05:00
parent 604ce68415
commit 4340fc5045

View File

@@ -164,6 +164,16 @@ class SdkStateBridge(
}
.launchIn(scope)
// ── NODE_STATUS_APP: update node status string ───────────────────────
accessor.client
.flatMapLatest { client -> client?.packets ?: flowOf() }
.filter { it.decoded?.portnum == PortNum.NODE_STATUS_APP }
.onEach { packet ->
val status = packet.decoded?.payload?.utf8() ?: return@onEach
nodeRepository.updateNode(packet.from) { it.copy(nodeStatus = status) }
}
.launchIn(scope)
// ── Events (notifications, security, backpressure) ──────────────────
accessor.client
.flatMapLatest { client -> client?.events ?: flowOf() }