fix(position-config): stop writing deprecated gpsEnabled on save (#2024)#2110
fix(position-config): stop writing deprecated gpsEnabled on save (#2024)#2110bruschill wants to merge 2 commits into
Conversation
…htastic#2024) PositionConfig saves were still setting the deprecated pc.gpsEnabled field (gps_enabled = 4) on every write, sending it to all firmware regardless. Its successor gps_mode has been the source of truth since v2.2.21 and the field is annotated [deprecated=true] upstream. - Stop writing pc.gpsEnabled; persist only pc.gpsMode. - Keep backward-compat on read: setPositionValues() still tolerates gpsEnabled/deviceGpsEnabled arriving from older firmware and maps it onto the GPS mode UI (deviceGpsEnabled && gpsMode != 1 -> gpsMode = 1).
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe position configuration save flow no longer writes deprecated ChangesPosition GPS mode migration
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Meshtastic/Views/Settings/Config/PositionConfig.swift`:
- Around line 324-327: Update docs/user/settings.md to document the Position
settings GPS migration: gpsMode is the sole persisted/outgoing source of truth,
while legacy gpsEnabled is only retained for backward-compatible reads. Ensure
the documentation reflects this behavior alongside the existing GPS settings
description.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a7be9e5b-6df1-421c-82d7-ada6b86cfbfa
📒 Files selected for processing (1)
Meshtastic/Views/Settings/Config/PositionConfig.swift
Address CodeRabbit review on meshtastic#2110: document in docs/user/settings.md that gpsMode is the sole source of truth the app writes, while the deprecated gpsEnabled field is read-only for backward compatibility with older firmware. Regenerate the bundled HTML docs.
What changed?
Stopped writing the deprecated
PositionConfig.gpsEnabledfield (gps_enabled = 4) when saving Position config. The save path now persists onlypc.gpsMode. The read-side legacy bridge insetPositionValues()is retained, sogpsEnabled/deviceGpsEnabledarriving from older firmware is still tolerated and mapped onto the GPS mode UI (deviceGpsEnabled && gpsMode != 1→gpsMode = 1).Fixes #2024
Why did it change?
gps_enabledis deprecated upstream ([deprecated=true]); its successorgps_mode = 13has been the source of truth since v2.2.21, and Android/upstream usegps_modeexclusively. The Apple app was re-emitting the deprecated field to all firmware on every save. This removes that while keeping backward-compatible reads.How is this tested?
gpsEnabled(remaining hits are protobuf codegen and incoming device→app persistence).gpsModeis persisted as source of truth at bothupsertPositionConfigPacketbranches, so the GPS mode UI still resolves correctly after save + config read.Screenshots/Videos (when applicable)
N/A — no user-visible UI change (the GPS Mode picker, labels, and navigation are unchanged).
Checklist
docs/user/ordocs/developer/. No doc update is needed (no user-visible UI/label/navigation change) —skip-docs-checklabel applies.Known accepted tradeoff
Genuinely old firmware that honors only
gps_enabledand ignoresgps_modewill read the defaultfalse. This is the explicit intended tradeoff in #2024 (matching Android/upstream, which emitgps_modeexclusively).