* fixes #11466

* Keep locally-addressed routing feedback out of the phone echo filter

allocForSending stamps ACK/NAK packets with from == our nodenum and sendLocal
defaults to RX_SRC_RADIO, so the loopback gate never applies. Filtering on
isFromUs alone dropped implicit rebroadcast ACKs, duty-cycle and NO_INTERFACE
NAKs, and PhoneAPI rate-limit errors on their way to the client.

Add coverage through the real RoutingModule, which the mocked one used by the
rest of the suite cannot exercise, and correct the test seam comment.

* Clean up the temporary RoutingModule in tearDown()

A failed Unity assertion longjmps out of the test, so the in-test delete never
ran and the module stayed registered in MeshModule::modules for every later
test. Track it at file scope, as realNeighborInfoModule already is.
This commit is contained in:
Thomas Göttgens
2026-08-14 09:12:31 +00:00
committed by GitHub
parent 4d524320b5
commit a661fd8cd4
3 changed files with 131 additions and 0 deletions
+8
View File
@@ -114,6 +114,14 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
}
}
// Our own packet heard back off the mesh, which the duplicate cache only suppresses best-effort.
// Clients can't tell an echo from genuine ingress, so it surfaces as an incoming message. Packets
// addressed to us are locally-generated feedback (implicit ACK, NAK, routing error), not an echo.
if (isFromUs(mp) && !isToUs(mp)) {
LOG_DEBUG("Skip phone echo of our own packet 0x%08x", mp->id);
return 0;
}
printPacket("Forwarding to phone", mp);
if (auto *toPhone = packetPool.allocCopy(*mp))
sendToPhone(toPhone);
+3
View File
@@ -222,6 +222,9 @@ class MeshService
/// needs to keep the packet around it makes a copy
int handleFromRadio(const meshtastic_MeshPacket *p);
friend class RoutingModule;
#ifdef PIO_UNIT_TESTING
friend class MeshServicePhoneDeliveryTest;
#endif
};
extern MeshService *service;