feat(lora): honor a pinned-preset intent advertised for UNSET - #6711
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe change adds explicit handling for firmware-advertised ChangesUNSET preset handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR narrowly changes fresh-setup preset selection for firmware that explicitly advertises a pinned preset while preserving existing behavior otherwise; no actionable merge-blocking risk remains after normal checks and review. Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (6 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A build that pins a preset can advertise it as UNSET's entry in LoRaRegionPresetMap (firmware #11507), stating the preset is deliberate. Fresh setup then keeps it (legality-repaired only), covering even a pinned LONG_FAST that the placeholder heuristic cannot distinguish. Inert for maps without an UNSET entry, which is all shipped firmware. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
UNSET's map entry states pin intent, not a constraint; without this gate a pinned build's single-preset group would collapse the dropdown until a region is picked. Confirmed as the intended reading in #6704. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6df3d1c to
fe46acf
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Why
Second half of #6704 (stacked on the placeholder-gate PR).
The placeholder heuristic in the previous PR can't tell a vendor build that deliberately pins
LONG_FASTfrom a stock install: both report regionUNSET+LONG_FAST. meshtastic/firmware#11507 closes that gap by advertising anUNSETentry inLoRaRegionPresetMapwhen, and only when, the build pins a preset, stating the pin as the group's sole entry and default.What changed
🌟
presetForRegionChange()now treats a non-nullconstraintFor(RegionCode.UNSET)as an explicit statement that the current preset is deliberate: fresh setup keeps it (legality-repaired only), even when it isLONG_FAST. Firmware that sends noUNSETentry (stock builds, and everything shipped today) falls through to the placeholder heuristic unchanged.Notes for reviewers
UNSETlookup is scoped to the fresh-setup decision only: the picker's constraint lookup now explicitly skipsUNSET, so a pinned build's single-entry group never collapses the dropdown while the region is still unset — matching #11507's "intent, not enforcement", and confirmed as the intended reading by the map's author on Fresh-setup preset default overwrites a preset that is still legal in the chosen region #6704. Behavior-neutral on firmware without the entry (constraintFor(UNSET)was null there anyway).UNSETentry, so behavior is identical to the previous PR until firmware#11507 lands.Testing Performed
:core:model:allTests— new tests: a map with anUNSETentry keeps a pinnedLONG_FASTat fresh setup; the same pin is still legality-repaired when illegal in the chosen region; maps without anUNSETentry keep the placeholder heuristic.:feature:settings:allTests,spotlessCheck,detekt,kmpSmokeCompile— green.Summary by CodeRabbit
LONG_FAST.