Skip to content

Fix crash on usb disconnect, fix hiding of main window #12864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 16, 2025

Conversation

DonLakeFlyer
Copy link
Contributor

@DonLakeFlyer DonLakeFlyer commented May 16, 2025

* This was causing main window to close when activeVehicle went away
* They are not needed since there are already correct activeVehicle checks which cause map items to hide
@DonLakeFlyer DonLakeFlyer requested review from Copilot and HTRamsey May 16, 2025 18:12
Copy link
Contributor

@Copilot 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 resolves multiple issues including crashes on USB cable disconnect, unexpected main window disappearance when the active vehicle changes, and incorrect link error dialogs.

  • Fallback to an offline editing vehicle when activeVehicle is null
  • Removal of redundant activeVehicle change connections in QML
  • Updates to SerialLink error handling for USB disconnects and a dedicated communication error handler in LinkManager

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/QmlControls/FactValueGrid.cc Adds a fallback for activeVehicle to use offlineEditingVehicle
src/FlightDisplay/FlyViewMap.qml Removes Connections blocks handling activeVehicle changes
src/Comms/SerialLink.cc Handles ResourceError with fallthrough to PermissionError logic
src/Comms/LinkManager.h & LinkManager.cc Introduces a dedicated _communicationError handler and connection
Comments suppressed due to low confidence (1)

src/Comms/LinkManager.h:127

  • [nitpick] Consider clarifying the parameter names to better reflect their usage (e.g., swapping or renaming them) to match the order of arguments in the showAppMessage() call.
void _communicationError(const QString &title, const QString &error);

@DonLakeFlyer DonLakeFlyer changed the title Usb disconnect Fix crash on usb disconnect, fix hiding of main window May 16, 2025
@DonLakeFlyer
Copy link
Contributor Author

@rubenp02 I could see why those two Connections blocks were needed. There was already activeVehicle checking in other places on the goto location item. I also tested the vehicle going away while a goto location was displayed and it correctly went away.

@DonLakeFlyer
Copy link
Contributor Author

  • Stops popping link error dialog on usb cable pull

@HTRamsey This didn't happen in pre-5.0 builds. It's kinda annoying. Not sure what you think about this change.

@HTRamsey
Copy link
Collaborator

@DonLakeFlyer yeah that's fine. I kinda wish we had a separate notification message that just kinda pops up and fades out after a few seconds, particularly for things like this that the user should notice but doesn't require actual input to dismiss it.

@HTRamsey
Copy link
Collaborator

I believe that change in FactValueGrid should fix these warnings too right? It'll be the offline vehicle instead of null now I think
image

@DonLakeFlyer
Copy link
Contributor Author

I believe that change in FactValueGrid should fix these warnings too right?

The second one. But not GuidedActionsController

I'm going to merge this because without it the main window close thing makes testing really hard!

@DonLakeFlyer DonLakeFlyer merged commit 1211230 into master May 16, 2025
16 checks passed
@DonLakeFlyer DonLakeFlyer deleted the USBDisconnect branch May 16, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QGC crashes after disconnecting USB [Release V5.0]
2 participants