fix(canned-messages): stop writing deprecated allow_input_source (#2022)#2111
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe canned-message configuration save path no longer writes the deprecated ChangesCanned message configuration
Estimated code review effort: 2 (Simple) | ~5 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 |
What changed?
Stopped writing the deprecated
CannedMessageConfig.allow_input_sourcefield (allow_input_source = 10) when saving Canned Messages module config.if/elseblock in the save closure ofCannedMessagesConfig.swiftthat setcmc.allowInputSourceto"rotEnc1"/"upDown1"/"_any".rotary1Enabled/updown1Enabledtoggles, which are still written. So no visible control was removed.Fixes #2022
Why did it change?
allow_input_sourceis deprecated upstream ([deprecated = true], since v2.7.4) and removed from active use with no successor. The input source is governed by therotary1_enabled/updown1_enabledflags, which the app still sends. The field should simply no longer be written.How is this tested?
allowInputSourceno longer appears anywhere in the app or tests except the explanatory comment — no other write, read, UI control, orDeviceProfile/AppIntents/CarPlay site.CannedMessageConfigEntity) and fromUpdateSwiftData'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).Screenshots/Videos (when applicable)
N/A — no user-visible UI change (no control existed for this field; the Canned Messages screen is unchanged).
Checklist
docs/user/ordocs/developer/. No doc update is needed (no user-visible control/label/navigation change) —skip-docs-checklabel applies.Note for reviewers
Residual (low/theoretical) risk: truly ancient firmware that both enforced
allow_input_sourceby 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.enabledis 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