Repository navigation
fix: surface routing NAKs on remote admin and node requests - #7749
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
A request the target or the mesh answers with a routing NAK was shown as unreachable after a timeout, or never answered at all. Remote admin to a node that refuses our key said "Could not reach node"; traceroute, telemetry, position, user info, neighbor info and metadata requests just sat on "Requesting". `MeshPacket.routingNakOrNull` reads a NAK off `meshPacketFlow`. The remote admin session ensure ends as `Rejected` when one answers its metadata request, and the snackbar names the refusal when the target sent it. `RequestNakWatcher` shows "<request> from <node> failed: <reason>" for the node requests. Awaited admin sends no longer treat a relay's implicit ACK as delivery: an ACK completes the wait only when it comes from the destination. fixes #7732
1a01f2d to
09ab2b9
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
A request the target or the mesh answers with a routing NAK was reported as unreachable after a timeout, or never resolved at all. Remote admin to a node that refuses our key said "Could not reach node" after 30 s, and traceroute, telemetry, position, user info, neighbor info and metadata requests sat on "Requesting" with nothing after.
🐛 Bug Fixes
MeshPacket.routingNakOrNull()reads a routing NAK (request id, sender, error) offmeshPacketFlow, the same streamRadioConfigViewModelalready watches.EnsureRemoteAdminSessionUseCasepicks the metadata request id itself and ends asRejectedwhen a NAK answers it. A NAK from the target shows its reason, e.g. "The remote node does not authorize your admin key."; our own node's key failures do too; a NAK from anywhere else still shows "Could not reach node". A fast local NAK ends the wait when it lands; a multi-hopMAX_RETRANSMITusually arrives after the 30 s deadline, so that case still reads as a timeout.RequestNakWatcherwatches each node request for five minutes and shows " from failed: ".requestPositionandrequestUserInfotake a request id, defaulting to one the sender assigns.completeDispatchedResponsetakes the sender. An ACK completes an awaited send only when it comes from the destination, so a relay's implicit ACK no longer reports a remotebegin_edit_settingsorcommit_edit_settingsas accepted. Remote edit boundaries now wait for the target's ACK, so if that ACK is lost while a relay's is heard, the edit fails after 30 s withEditSettingsTransactionExceptioneven when the write landed.🧹 Chores
val deferredblock inEnsureRemoteAdminSessionUseCase.ktonce the file was in the diff.Testing Performed
RoutingNakTest: NAKs are read with request and sender; ACKs, unanswered packets and other ports are not NAKs.EnsureRemoteAdminSessionUseCaseTest: a NAK on the request id returnsRejected; a NAK for another id and a plain ACK are ignored.RequestNakWatcherTest: a NAK to the request shows the failure; other ids and ACKs show nothing; a failed send stops watching.PacketHandlerImplTest: a relay's ACK leaves the wait open and the destination's NAK ends it as rejected.NodeDetailViewModelTest: a refusal from the target shows its detail; a NAK from another node shows unreachable.Firmware still reports a refused remote
set_*write as a plain ACK, becauseMeshModulediscards the refusal when the write did not ask for a response. That needs a firmware change and is not in this PR.Fixes #7732
Summary by CodeRabbit