Skip to content

Fix UI hang from refreshing params too fast#1080

Merged
Turnlings merged 8 commits into
mainfrom
1047-bug-fetching-params-too-fast-causes-ui-hang
Mar 15, 2026
Merged

Fix UI hang from refreshing params too fast#1080
Turnlings merged 8 commits into
mainfrom
1047-bug-fetching-params-too-fast-causes-ui-hang

Conversation

@Turnlings
Copy link
Copy Markdown
Contributor

@Turnlings Turnlings commented Mar 12, 2026

The cause was the mavserial function silently returning

image

@Turnlings Turnlings linked an issue Mar 12, 2026 that may be closed by this pull request
@Turnlings Turnlings marked this pull request as ready for review March 14, 2026 16:09
Copilot AI review requested due to automatic review settings March 14, 2026 16:09
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 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_id for parameter operations (instead of using the creating thread’s ident).
  • Refactor the getAllParamsThreadFunc loop control to use a local flag and move is_requesting_params = False to the finally block.
  • Add a time.sleep(1) after releasing the reserved PARAM_VALUE message type.

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

Comment thread radio/app/controllers/paramsController.py
Comment thread radio/app/controllers/paramsController.py Outdated
Comment thread radio/app/controllers/paramsController.py
@Turnlings Turnlings changed the title 1047 bug fetching params too fast causes UI hang Fix UI hang from refreshing params too fast Mar 14, 2026
@Turnlings Turnlings requested a review from Copilot March 14, 2026 17:13
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 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 calling param_fetch_all() when a fetch was started recently.

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

Comment thread radio/app/controllers/paramsController.py Outdated
@Turnlings Turnlings requested review from a team and 1Blademaster March 14, 2026 17:30
@Turnlings Turnlings self-assigned this Mar 14, 2026
Copy link
Copy Markdown
Member

@1Blademaster 1Blademaster left a comment

Choose a reason for hiding this comment

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

Don't fully understand why this fixes it, but I'm happy it works.

@Turnlings Turnlings merged commit f7a6802 into main Mar 15, 2026
7 of 8 checks passed
@Turnlings Turnlings deleted the 1047-bug-fetching-params-too-fast-causes-ui-hang branch March 15, 2026 12:32
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.

[BUG] Fetching params too fast causes UI hang

3 participants