Fix UI hang from refreshing params too fast#1080
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to address a UI hang encountered when refreshing/fetching parameters too quickly by reducing controller message-queue collisions and adjusting the lifecycle of the parameter-fetching thread in the radio backend.
Changes:
- Generate a per-instance
controller_idfor parameter operations (instead of using the creating thread’s ident). - Refactor the
getAllParamsThreadFuncloop control to use a local flag and moveis_requesting_params = Falseto thefinallyblock. - Add a
time.sleep(1)after releasing the reservedPARAM_VALUEmessage type.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR addresses a UI hang when the client refreshes parameters too quickly by introducing a short delay before triggering a new MAVLink param_fetch_all() request, avoiding a silent return condition in the underlying MAVLink serial logic.
Changes:
- Add a timing guard in
getAllParams()to wait (up to ~2s) before callingparam_fetch_all()when a fetch was started recently.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1Blademaster
left a comment
There was a problem hiding this comment.
Don't fully understand why this fixes it, but I'm happy it works.
The cause was the mavserial function silently returning