mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-09-14 17:56:38 +00:00
parsePacketPayload copies message/msg_hash/sender_timestamp/attempt/txt_type from a prior channels_log entry matched by pkt_hash. When that prior entry was logged while the channel could not be decrypted it has none of those keys, so a later duplicate of the same transmission raises KeyError: 'message' and aborts handle_rx for the whole packet, dropping its RX_LOG_DATA. It triggers when a channel-table refresh lands between two copies of a flooded channel message. Copy with .get() so the fields are simply absent instead of raising. Adds a regression test that reproduces the crash (fails on main, passes here).
MeshCore Tests
Running Tests
To run the tests, first install the development dependencies:
pip install -e ".[dev]"
Then run the tests using pytest:
# Run all tests
pytest
# Run tests with verbose output
pytest -v
# Run a specific test file
pytest tests/unit/test_commands.py
# Run a specific test
pytest tests/unit/test_commands.py::test_send_msg