Fix UART/BLE status reporting gate and test isolation - #9
Merged
Conversation
Previously, process_mesh_operations() gated both BLE notifications and UART status sends on is_add_packet_buf_ready() && !uart_manager.started(). Once the UART daemon connected, started() returned true and ALL status reporting silently stopped — BLE included. The fix separates the two reporting paths: - BLE: gated only on is_add_packet_buf_ready() - UART: gated only on uart_manager.uart_status_reporting_enabled() - Mesh status data collected once and shared between both sinks Supporting changes: - mesh_node_report_status tagged #[cfg_attr(test, mry::mry)] to enable mocking - reset_global_state() in connection tests resets app().uart_manager to prevent mock state leaking into later tests - reset_app_uart_for_test() added to lib.rs as a direct-access helper that resets the global APP's uart_manager without going through the mockable app_mocker(), so it is safe to call from test helpers that run inside a mry::lock(app_mocker) scope - reset_test_state() in packet_processing tests calls reset_app_uart_for_test() to eliminate mock contamination from preceding connection tests - Two new tests: test_process_mesh_operations_ble_and_uart_are_independent and test_process_mesh_operations_ble_fires_without_uart
📊 Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, process_mesh_operations() gated both BLE notifications and UART status sends on is_add_packet_buf_ready() && !uart_manager.started(). Once the UART daemon connected, started() returned true and ALL status reporting silently stopped — BLE included.
The fix separates the two reporting paths:
Supporting changes: