Skip to content

fix(canned-messages): stop writing deprecated allow_input_source (#2022)#2111

Open
bruschill wants to merge 1 commit into
meshtastic:mainfrom
bruschill:fix/canned-messages-drop-deprecated-allow-input-source-2022
Open

fix(canned-messages): stop writing deprecated allow_input_source (#2022)#2111
bruschill wants to merge 1 commit into
meshtastic:mainfrom
bruschill:fix/canned-messages-drop-deprecated-allow-input-source-2022

Conversation

@bruschill

@bruschill bruschill commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What changed?

Stopped writing the deprecated CannedMessageConfig.allow_input_source field (allow_input_source = 10) when saving Canned Messages module config.

  • Removed the derived if/else block in the save closure of CannedMessagesConfig.swift that set cmc.allowInputSource to "rotEnc1" / "upDown1" / "_any".
  • There was no dedicated UI control for this field — it was derived from the existing rotary1Enabled / updown1Enabled toggles, which are still written. So no visible control was removed.

Fixes #2022

Why did it change?

allow_input_source is deprecated upstream ([deprecated = true], since v2.7.4) and removed from active use with no successor. The input source is governed by the rotary1_enabled / updown1_enabled flags, which the app still sends. The field should simply no longer be written.

How is this tested?

  • Repo-wide scan confirms allowInputSource no longer appears anywhere in the app or tests except the explanatory comment — no other write, read, UI control, or DeviceProfile/AppIntents/CarPlay site.
  • Read-side is already backward-compatible: the field is absent from the SwiftData model (CannedMessageConfigEntity) and from UpdateSwiftData's canned-message upsert, so values arriving from older firmware deserialize into the protobuf struct and are silently ignored — no crash, nothing to change.
  • hasChanges/save-button behavior is unaffected (no @State/onChange/load tied to this field).
  • SourceKit-LSP: no diagnostics on the changed file.
  • Reviewed with the project's Swift reviewer — approved, no blocking issues.

Screenshots/Videos (when applicable)

N/A — no user-visible UI change (no control existed for this field; the Canned Messages screen is unchanged).

Checklist

  • My code adheres to the project's coding and style guidelines.
  • I have conducted a self-review of my code.
  • I have commented my code, particularly in complex areas.
  • I have verified whether these changes require updates to the in-app documentation under docs/user/ or docs/developer/. No doc update is needed (no user-visible control/label/navigation change) — skip-docs-check label applies.
  • I have tested the change to ensure that it works as intended.

Note for reviewers

Residual (low/theoretical) risk: truly ancient firmware that both enforced allow_input_source by exact-string match and treated an absent value as "no source" would now receive no source hint. This is discounted because the field is upstream-deprecated, was never persisted by the app, and the old "upDown1" value the app used to send isn't even in the proto's documented value set ("upDownEnc1") — strong evidence the string was already non-authoritative and the flags drive behavior. Separately, CannedMessageConfig.enabled is also [deprecated] but is intentionally left in place here — it still has current effect and its removal wasn't requested in #2022.

Summary by CodeRabbit

  • Bug Fixes
    • Improved saving of canned-message input controls by relying on the current rotary and up/down control settings.
    • Prevented deprecated input-source values from being unintentionally persisted when saving configuration changes.

…htastic#2022)

CannedMessageConfig saves derived and wrote the deprecated allowInputSource
field (allow_input_source = 10) on every save. The field has been removed
from active use upstream with no successor \u2014 the firmware derives the input
source from the rotary1Enabled / updown1Enabled flags.

- Stop writing cmc.allowInputSource on save.
- No read-side change needed: the field was never persisted (absent from the
  SwiftData model and UpdateSwiftData), so values arriving from older firmware
  are already ignored without crashing.
@bruschill bruschill added the skip-docs-check Use this label to skip the automatic docs audit label Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 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: 6fc1d565-3a70-4154-91aa-40ba88e9881a

📥 Commits

Reviewing files that changed from the base of the PR and between e531f15 and 7458a9d.

📒 Files selected for processing (1)
  • Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift

📝 Walkthrough

Walkthrough

The canned-message configuration save path no longer writes the deprecated allowInputSource field. Comments document that input selection is controlled by the rotary and up/down enable flags, while older-firmware values are ignored on save.

Changes

Canned message configuration

Layer / File(s) Summary
Stop persisting deprecated input source
Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift
Removes save-time assignment of allowInputSource and documents the continued handling of older-firmware values.

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

Suggested reviewers: garthvh

Poem

I’m a bunny with a tidy config trail,
Deprecated fields now quietly fail.
Rotary flags lead the way,
Old inputs rest where they lay.
No stale writes hop back in the mail.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific, concise, and accurately describes the main change.
Description check ✅ Passed The description matches the required template and includes what, why, testing, screenshots, and checklist details.
Linked Issues check ✅ Passed The change stops writing the deprecated field and preserves backward compatibility, matching #2022's core requirement.
Out of Scope Changes check ✅ Passed The diff stays focused on the deprecated field save path and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

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

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

Labels

skip-docs-check Use this label to skip the automatic docs audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate off deprecated CannedMessageConfig.allow_input_source (removed field, stop showing/writing)

1 participant