Skip to content

PR: Fix has_module_settings flag inconsistency in channel updates#10578

Draft
blahman5000 wants to merge 1 commit into
meshtastic:developfrom
blahman5000:fix/has_module_settings
Draft

PR: Fix has_module_settings flag inconsistency in channel updates#10578
blahman5000 wants to merge 1 commit into
meshtastic:developfrom
blahman5000:fix/has_module_settings

Conversation

@blahman5000
Copy link
Copy Markdown

@blahman5000 blahman5000 commented May 29, 2026

Summary

Fixes a bug where channels could be created/configured with populated module_settings (e.g., position_precision, is_muted) but leave has_module_settings=false. This caused position and mute state to be ignored by downstream code.

One consequence of this is that manual position requests on a channel configured for full-precision location would sometimes (depending on how the channel was created) return Null Island.

Root Cause

setChannel() was accepting incoming meshtastic_Channel objects without validating the has_module_settings flag. When a channel from an external source (phone API, etc.) carried module_settings data but didn't set the flag, those settings would overwrite the stored channel while appearing disabled.

Solution

Added normalization logic to setChannel() and fixupChannel():
If any module_settings fields are non-zero (position_precision or is_muted), ensure has_module_settings=true.

Testing

Idempotent: calling setChannel() multiple times on the same object has no side effects. fixupChannel() applies the same logic to stored channels at boot and on config changes (via onConfigChanged()).

Impact

Risk: Low — purely additive validation; no behavior changes for well-formed channels.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Heltec (Lora32) V4
    • Wio Tracker L1

…ring has_module_settings=true when any module_settings field is non-zero.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 29, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown
Contributor

@blahman5000, Welcome to Meshtastic!

Thanks for opening your first pull request. We really appreciate it.

We discuss work as a team in discord, please join us in the #firmware channel.
There's a big backlog of patches at the moment. If you have time,
please help us with some code review and testing of other PRs!

Welcome to the team 😄

@github-actions github-actions Bot added bugfix Pull request that fixes bugs first-contribution labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs first-contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants