Skip to content

RemoteID: restore operator ID validation and sanitizing#14262

Open
Junior00619 wants to merge 3 commits into
mavlink:masterfrom
Junior00619:fix/issue-14204-operator-id-validation
Open

RemoteID: restore operator ID validation and sanitizing#14262
Junior00619 wants to merge 3 commits into
mavlink:masterfrom
Junior00619:fix/issue-14204-operator-id-validation

Conversation

@Junior00619

Copy link
Copy Markdown

Fixes #14204.

Summary

  • restore Operator ID validation inside RemoteIDManager so the generated settings UI no longer bypasses the EU checksum path
  • sanitize validated EU Operator IDs back down to the public 16-character form before they are stored or reused
  • add RemoteIDManagerTest coverage for valid EU IDs, invalid EU IDs, and switching from FAA to EU after entering a validated full ID

Verification

  • configured QGroundControl in the repo's Ubuntu/Qt Docker build environment with -DQGC_BUILD_TESTING=ON
  • generated MAVLink headers and MAVLinkEnums.h in the build tree
  • compiled the touched translation units directly from compile_commands.json inside the container:
    • src/Vehicle/RemoteIDManager.cc
    • test/Vehicle/RemoteIDManagerTest.cc

I did not finish a full QGroundControl --unittest:RemoteIDManagerTest run locally because the complete application build is much larger than the changed scope here, so the remaining end-to-end validation should come from CI.

@Junior00619 Junior00619 requested a review from HTRamsey as a code owner April 3, 2026 18:36
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your first pull request! 🎉

A maintainer will review this soon. Please ensure:

  • CI checks pass
  • Code follows coding standards
  • Changes tested on relevant platforms

We appreciate your contribution to QGroundControl!

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 4 passed, 32 failed, 7 skipped.

Test Results

linux-sanitizers: 68 passed, 0 skipped
linux_gcc_64: 68 passed, 0 skipped
Total: 136 passed, 0 skipped

Artifact Sizes

Artifact Size
QGroundControl 248.05 MB
QGroundControl 338.23 MB
QGroundControl-aarch64 177.21 MB
QGroundControl-installer-AMD64 135.10 MB
QGroundControl-installer-AMD64-ARM64 77.74 MB
QGroundControl-installer-ARM64 106.48 MB
QGroundControl-mac 188.68 MB
QGroundControl-windows 188.71 MB
QGroundControl-x86_64 163.45 MB
No baseline available for comparison---
Updated: 2026-04-04 03:37:25 UTC • Triggered by: Android

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

@Davidsastresas Can you look at this and verify this is a correct thing to do?

@Davidsastresas

Copy link
Copy Markdown
Member

Thanks for tackling this, wiring validation to the Fact signals is the right approach, since the generated settings UI writes the operatorID Fact directly and never went through the old checkOperatorID()/setOperatorID() path. The reentrancy guard around the sanitizing write-back looks correct, and _setOperatorIDGood only emitting on change is a nice touch.

A couple of things before merge:

1. The PR description doesn't match the tests that shipped. The summary lists coverage for "switching from FAA to EU after entering a validated full ID," but that case isn't in the diff, there are only _validEUOperatorIDIsSanitized and _invalidEUOperatorIDClearsTrustedState, and neither switches region. Looks like narrow validation coverage to issue path dropped it. Since validation is region-independent (a valid full ID entered under FAA sets operatorIDValid=true, then switching to EU strips it), that transition is probably the most valuable case to keep, could we restore it, or at least update the description?

2. checkOperatorID() and setOperatorID() are now dead code. They're Q_INVOKABLE but have no callers anywhere in the repo after this change. checkOperatorID() now duplicates _handleOperatorIDChanged's validation, and setOperatorID() is just _refreshOperatorIDState(). Could we delete them (or have them delegate) rather than leave two parallel validation paths?

Minor:

  • length() > 16 is redundant with _isEUOperatorIDValid, which already requires exactly 19/20 chars. A named constant for the 16-char public length would also read better than the repeated literal.
  • operatorIDType >= 0 is always true (uint8, default 0). Pre-existing, just noting it's carried forward.

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.

Remote ID Operator ID not validated

3 participants