Commit Graph
8 Commits
Author SHA1 Message Date
Christoph Koehler 4f701b7aec refactor: split MeshTables::hasSeen into pure query + markSeen
hasSeen() was simultaneously a predicate and a mutator — it inserted the
packet hash on every miss, making five call sites that only wanted to mark
a packet as sent call it with the return value discarded.

Split into:
- wasSeen()   — pure predicate, no side effects
- markSeen()  — explicit insert

All query sites now call markSeen() immediately after wasSeen() returns
false, preserving identical runtime behaviour. The five mark-only send
sites (sendFlood, sendDirect, sendZeroHop x2) now call markSeen directly.

Also fixes three bridge sites (BridgeBase, ESPNowBridge, RS232Bridge)
that had the same query+implicit-insert pattern.

Tests: add test/test_mesh_tables/ covering wasSeen purity, markSeen,
dup stats, and clear. Update SHA256 mock to produce deterministic output
(previously finalize() was a no-op). Add Packet.cpp to native build filter.
2026-07-01 21:51:38 -06:00
Scott Powell f6e6fdaa05 * support for sending 5-byte ACKs 2026-05-17 22:10:13 +10:00
Scott Powell b11f43987b * companion: fix for importContact(). Now removes the packet-hash from table, before 'replaying' 2025-05-16 19:57:09 +10:00
Scott Powell 805ca7b900 * CommonCLI: added "clear stats" command 2025-05-13 18:12:58 +10:00
Scott Powell 3b5b7a1642 * SimpleMeshTables: ACKs now handled separately
* Dispatcher: logging methods now with 'len' param
2025-02-18 22:59:03 +11:00
Scott Powell 5811cf9f02 * repeater: Get Stats new fields added: n_direct_dups, n_flood_dups 2025-02-18 17:47:00 +11:00
Scott Powell 20fccac2b7 * refactored the hasSeen(Packet) stuff. 2025-01-14 06:43:03 +11:00
Scott Powell 6c7efdd0f6 Initial commit 2025-01-13 14:07:48 +11:00