mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-04-27 11:25:27 +00:00
879a86bd80
Simplifies find_recent_rf_data so the sample it returns is always a single wire observation — snr, rssi, raw_hex, and routing_info all belong to the same decoded copy. The #80 fix stays intact via the two earlier invariants: unmatched correlation_key returns None (no fallback to an unrelated recent packet), and the no-key DM path is constrained to a narrow rf_fallback_window. An earlier iteration tried to enrich routing_info with the longest observed same-packet_hash forward, but that would have left message_stats rows with hops sourced from the matched observation while path was a different forward's — an internal skew visible in the web viewer and !path output. The enrichment is documented in TODO.md as a v0.9.1+ option-C follow-up that must also sync message.hops for consistency. Regression tests in tests/test_message_handler.py::TestFindRecentRfData cover: return-None on unmatched key, narrow-fallback-window rejection of stale samples, and the no-cross-wiring assertion for same-packet_hash forwards. Made-with: Cursor