Skip to content

Add error reporting for SITL child process failures#2562

Open
sensei-hacker wants to merge 2 commits intoiNavFlight:maintenance-9.xfrom
sensei-hacker:fix/sitl-error-reporting
Open

Add error reporting for SITL child process failures#2562
sensei-hacker wants to merge 2 commits intoiNavFlight:maintenance-9.xfrom
sensei-hacker:fix/sitl-error-reporting

Conversation

@sensei-hacker
Copy link
Member

@sensei-hacker sensei-hacker commented Feb 14, 2026

User description

SITL spawn errors and unexpected exits were silently swallowed — the renderer never subscribed to child process error/exit events. Users saw only "ECONNREFUSED" with no indication of the actual cause.

  • Forward spawn errors and process error events to renderer via IPC
  • Add exit event handler to detect abnormal termination
  • Log errors to both console and GUI log
  • Remove ineffective useShell option (not a valid Node.js spawn property)

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 14, 2026

ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

Comment on lines 74 to 80
message_buffer: null,
message_buffer_uint8_view: null,
message_checksum: 0,
message_flag: 0,
callbacks: [],
packet_error: 0,
unsupported: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Reset the message_flag property in the finally block of _dispatch_message to ensure the MSP state machine is always in a consistent state. [general, importance: 7]

New proposed code:
-var MSP = {
-    message_buffer:             null,
-    message_buffer_uint8_view:  null,
-    message_checksum:           0,
-    message_flag:               0,
-    callbacks:                  [],
-    packet_error:               0,
-    unsupported:                0,
 
+

Previously, SITL spawn errors and unexpected exits were completely
silent - the renderer never subscribed to child process error/exit
events. Now errors are logged to both console and the GUI log so
users can see why Demo mode or SITL connections fail.

Also removes the ineffective useShell option (not a valid Node.js
spawn property, was silently ignored).
@sensei-hacker sensei-hacker force-pushed the fix/sitl-error-reporting branch from d6a55a0 to 828d257 Compare February 14, 2026 16:39
Store handler references and remove old listeners before
re-registering to prevent accumulation on repeated start/stop cycles.
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.

1 participant