Skip to content

Refactor position precision handling to honor explicit channel settings and prevent location leaks#10513

Merged
thebentern merged 1 commit into
developfrom
fix-precision-regression
May 20, 2026
Merged

Refactor position precision handling to honor explicit channel settings and prevent location leaks#10513
thebentern merged 1 commit into
developfrom
fix-precision-regression

Conversation

@thebentern

Copy link
Copy Markdown
Contributor

Fixes #10509

@thebentern thebentern requested a review from Copilot May 20, 2026 13:40
@github-actions github-actions Bot added needs-review Needs human review enhancement New feature or request labels May 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a privacy bug where full-precision position could be shared even when a public channel had position sharing disabled, by changing position-precision selection to honor explicit per-channel module settings and otherwise “fail closed”.

Changes:

  • Refactored getPositionPrecisionForChannel to accept a meshtastic_Channel and return 0 when module settings are absent (removing the previous PRIMARY-channel default of 32).
  • Updated the channel-index overload to delegate to the new channel-based helper.
  • Added unit tests that verify explicit precision values are honored and that missing module settings disable position precision (regression coverage for #10509).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/mesh/PositionPrecision.h Adds channel-based overload declaration and required include for meshtastic_Channel.
src/mesh/PositionPrecision.cpp Implements fail-closed precision selection and delegates index-based lookup to the new helper.
test/test_position_precision/test_main.cpp Adds tests covering explicit precision, explicit disable (0), and fail-closed behavior when module settings are absent.

@thebentern thebentern merged commit 2f92eb8 into develop May 20, 2026
85 of 86 checks passed
thebentern added a commit that referenced this pull request May 22, 2026
@thebentern thebentern deleted the fix-precision-regression branch May 23, 2026 00:06
Evil8it pushed a commit to Evil8it/ME4TACTNK that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Precise position is shared on a position-disabled public channel

2 participants