mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-16 16:41:33 +10:00
* 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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user