Skip to content

Commit 777e11b

Browse files
authored
Bug / Send upgraded (duplicate) packets to phone if the queue removal failed. (#8148)
* Add seenRecently = true if wasUpgraded is true but unable to remove from queue (i.e. already sent/processed). * Consistent comment between FloodingRouter and HopRouter
1 parent 7633ddc commit 777e11b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/mesh/FloodingRouter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ bool FloodingRouter::shouldFilterReceived(const meshtastic_MeshPacket *p)
5454
// We already enqueued the improved copy, so make sure the incoming packet stops here.
5555
return true;
5656
}
57+
58+
// No queue entry was replaced by this upgraded copy, so treat it as a duplicate to avoid
59+
// delivering the same packet to applications/phone twice with different hop limits.
60+
seenRecently = true;
5761
}
5862

5963
if (seenRecently) {

src/mesh/NextHopRouter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ bool NextHopRouter::shouldFilterReceived(const meshtastic_MeshPacket *p)
6464
// We already enqueued the improved copy, so make sure the incoming packet stops here.
6565
return true;
6666
}
67+
68+
// No queue entry was replaced by this upgraded copy, so treat it as a duplicate to avoid
69+
// delivering the same packet to applications/phone twice with different hop limits.
70+
seenRecently = true;
6771
}
6872

6973
if (seenRecently) {

0 commit comments

Comments
 (0)