Skip to content

Migrate off deprecated PositionConfig.gps_enabled (use gps_mode) #2024

Description

@garthvh

🤖 Good task for an agent: this is a self-contained, well-scoped migration ideal for an automated coding agent.

Summary

The Apple app still writes the deprecated PositionConfig.gps_enabled field on every Position config save. Per the upstream deprecated-fields audit, this field's successor is gps_mode = 13. This was a ⚠️ (partial) row rather than a clean red X: the app already reads gps_mode, but it also reads deviceGpsEnabled as a legacy-bridge fallback on load and, on every write, sets pc.gpsEnabled = gpsMode == 1 alongside pc.gpsMode — sending the deprecated field to all firmware versions regardless.

Field Detail
Proto message PositionConfig
Deprecated field gps_enabled = 4
Deprecated since gps_mode added v2.2.21 (2024-02-01); [deprecated=true] annotated v2.7.4
Stable v2.7.15
Replacement gps_mode = 13 (GpsMode enum: NOT_PRESENT / ENABLED / DISABLED)
Android status ✅ Not shown — PositionConfigScreen uses gps_mode exclusively
Apple status ⚠️ Written on every save

Audit reference

https://github.com/meshtastic/design/blob/master/standards/audits/deprecated-fields-audit.md

Suggested approach

  1. Grep the Apple codebase for the Swift symbols (e.g. gpsEnabled, deviceGpsEnabled, gps_enabled, and gpsMode / gps_mode) and the Position config settings form / save path.
  2. Stop writing gpsEnabled when saving PositionConfig — persist only gpsMode.
  3. Keep backward-compat on read: continue tolerating gpsEnabled arriving from older firmware (the legacy-bridge fallback), but treat gpsMode as the source of truth; don't re-emit the deprecated field.
  4. Verify saving Position config no longer sets gpsEnabled, and that reading a config from older firmware still maps correctly onto the GPS mode UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions