Skip to content

Filter deprecated Long Slow modem preset from picker#2048

Open
mizadi wants to merge 1 commit into
meshtastic:mainfrom
mizadi:filter-longslow-modem-preset-2020
Open

Filter deprecated Long Slow modem preset from picker#2048
mizadi wants to merge 1 commit into
meshtastic:mainfrom
mizadi:filter-longslow-modem-preset-2020

Conversation

@mizadi

@mizadi mizadi commented Jul 6, 2026

Copy link
Copy Markdown

What & why

Closes #2020.

The app still offered the deprecated LoRaConfig.ModemPreset value LONG_SLOW for new selection in the modem-preset picker. Per the upstream deprecated-fields audit this preset is being removed, and Android already filters it out. This change stops offering it for new selection while keeping full backward-compatibility for radios already configured on it.

Changes

  • Added an isDeprecated flag to ModemPresets (currently just longSlow), following the same keep-the-case-but-filter pattern already used for requiresFirmware2_8.
  • ModemPresets.selectable(supports2_8:) now excludes deprecated presets, so longSlow no longer appears in the LoRa config picker or the discovery scan preset list.
  • Kept the longSlow case so an existing radio's value still round-trips through protobuf and renders its label.
  • In LoRaConfig's availablePresets, a currently-configured deprecated preset is kept visible so the picker never shows a blank selection for an existing longSlow config.
  • Added unit tests: longSlow is excluded from the selectable set (both firmware levels) and from userSelectable, and still exists for label display.

Testing

  • MeshtasticTests/LoRaFirmwareGatingTests pass locally (11 tests, incl. the 2 new ones); no existing tests broken.
  • SwiftLint: no new warnings vs. main.

PR Checklist

  • All existing tests pass
  • New tests written
  • SwiftLint reports no new errors or warnings

Summary by CodeRabbit

  • Bug Fixes

    • Deprecated radio presets are no longer shown as selectable options.
    • Existing setups using a deprecated preset will still display it correctly instead of appearing blank.
  • Tests

    • Added coverage for deprecated preset handling and display behavior.

The app still offered the deprecated LoRaConfig.ModemPreset LONG_SLOW value
for new selection. Mirroring how Android filters it out, exclude it from the
selectable preset list via a new `isDeprecated` flag on `ModemPresets`.

The `longSlow` case is kept so a radio already configured on it round-trips
through protobuf and still renders its label, and the LoRa config picker keeps
a currently-configured deprecated preset visible so it never shows blank.

Adds unit tests covering exclusion from the selectable set and backward-compat
display.

Closes meshtastic#2020
@CLAassistant

CLAassistant commented Jul 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 60c34254-af7b-4625-afa3-5a3474943f55

📥 Commits

Reviewing files that changed from the base of the PR and between efa3c09 and 9bb0fe0.

📒 Files selected for processing (3)
  • Meshtastic/Enums/LoraConfigEnums.swift
  • Meshtastic/Views/Settings/Config/LoRaConfig.swift
  • MeshtasticTests/LoraDeviceEnumTests.swift

📝 Walkthrough

Walkthrough

Introduces an isDeprecated property on ModemPresets, filters deprecated presets from selectable(supports2_8:), and updates the LoRa config picker to still display an already-configured deprecated preset (longSlow) rather than showing a blank selection. Adds corresponding tests.

Changes

Deprecate longSlow modem preset

Layer / File(s) Summary
isDeprecated property and selectable filtering
Meshtastic/Enums/LoraConfigEnums.swift
Adds isDeprecated computed property (true for longSlow) and filters deprecated presets out of selectable(supports2_8:).
Picker preserves deprecated current preset
Meshtastic/Views/Settings/Config/LoRaConfig.swift
availablePresets appends the current modemPreset back into the list when it is deprecated but missing after region/support filtering, avoiding a blank picker selection.
Tests for deprecated preset behavior
MeshtasticTests/LoraDeviceEnumTests.swift
Adds tests confirming longSlow is deprecated, excluded from selectable/userSelectable sets, and still round-trips correctly with the right display name.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A slow old preset, once picked with glee,
Now hops off the list — but stays if it's "me"!
No blank little gaps in the picker's fine row,
Just tests hopping through to make sure it's so. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main change: filtering the deprecated Long Slow modem preset from the picker.
Description check ✅ Passed Description covers what changed, why, testing, and checklist items, matching the repository template well.
Linked Issues check ✅ Passed Changes address #2020 by filtering longSlow from selectable presets while preserving existing-config display.
Out of Scope Changes check ✅ Passed No clear out-of-scope changes are evident; edits stay focused on Long Slow filtering and its tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@mizadi

mizadi commented Jul 7, 2026

Copy link
Copy Markdown
Author

@thebentern The red "Check docs coverage" check is a CI/permissions issue, not a problem with this change.
The job fails on its "Post warning comment" step with: RequestError [HttpError]: Resource not accessible by integration status: 403
Because this PR is from a fork, GITHUB_TOKEN is read-only, so the workflow can't post its advisory docs-staleness comment and the step errors out. The check is advisory by design (its "Set check status" step is skipped), so the failure is purely the comment-post permission, not a code or docs problem.
All other checks (SwiftLint, tests) are green and the PR is approved. Should be good to merge whenever you're ready. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate off deprecated LoRaConfig.ModemPreset.LONG_SLOW (stop offering it in picker)

3 participants