Skip to content

800 refactor drone checkformessages#802

Merged
1Blademaster merged 12 commits intomainfrom
800-refactor-drone-checkformessages
Nov 3, 2025
Merged

800 refactor drone checkformessages#802
1Blademaster merged 12 commits intomainfrom
800-refactor-drone-checkformessages

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

…eset dashboard statustext messages when connecting to an aircraft
@1Blademaster 1Blademaster linked an issue Oct 30, 2025 that may be closed by this pull request
@1Blademaster
Copy link
Copy Markdown
Member Author

Because logic has changed, most tests are broken. The FakeTCP helper raising a serial exception causes the aircraft to assume there is an issue with the serial connection, and disconnects.

@1Blademaster 1Blademaster marked this pull request as ready for review October 31, 2025 13:37
Copilot AI review requested due to automatic review settings October 31, 2025 13:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the MAVLink message handling system by introducing a message reservation mechanism to prevent race conditions between controllers. Key changes include:

  • Replaced the global is_listening flag with a message reservation system using queues
  • Added wait_for_message(), reserve_message_type(), and release_message_type() methods
  • Created a separate /telemetry namespace for telemetry socket messages
  • Updated all controllers to use the new message reservation pattern
  • Added a test timeout decorator and consolidated test helper classes

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
radio/app/drone.py Introduced message reservation system with queues, removed is_listening flag, added new wait/reserve/release methods
radio/app/controllers/*.py Updated all controllers to use message reservation pattern with try/finally blocks
radio/app/utils.py Added namespace parameter to sendMessage() socketio emission
radio/app/endpoints/telemetry_namespace.py New telemetry namespace handler for WebSocket connections
radio/app/init.py Registered the telemetry namespace
radio/tests/helpers.py Consolidated test helper classes into WaitForMessageReturnsNone
radio/tests/*.py Updated test files to use renamed helper classes and added timeout decorator
gcs/src/redux/middleware/socketMiddleware.js Moved incoming message handler to telemetry socket, removed status text reset
gcs/src/redux/middleware/emitters.js Moved status text reset to connect action
gcs/src/helpers/socket.js Added telemetry socket connection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/app/controllers/paramsController.py Outdated
Comment thread radio/app/controllers/paramsController.py Outdated
Comment thread radio/app/controllers/armController.py Outdated
Comment thread radio/app/drone.py Outdated
@1Blademaster 1Blademaster force-pushed the 800-refactor-drone-checkformessages branch from 5d47ed9 to 1cfe277 Compare October 31, 2025 14:44
@1Blademaster 1Blademaster requested a review from Copilot October 31, 2025 14:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/app/drone.py
Comment thread radio/app/utils.py
Comment thread radio/app/drone.py Outdated
Comment thread radio/app/endpoints/autopilot.py
Comment thread radio/app/controllers/missionController.py
Comment thread radio/app/controllers/flightModesController.py
Comment thread radio/app/drone.py Outdated
Comment thread gcs/src/redux/middleware/socketMiddleware.js
Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 31, 2025

@1Blademaster I've opened a new pull request, #803, to work on those changes. Once the pull request is ready, I'll request review from you.

@1Blademaster 1Blademaster requested a review from a team October 31, 2025 15:11
@1Blademaster 1Blademaster merged commit 9de8516 into main Nov 3, 2025
8 checks passed
@1Blademaster 1Blademaster deleted the 800-refactor-drone-checkformessages branch November 3, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor drone checkForMessages

4 participants