fix(device-config): surface and migrate deprecated Repeater role (#2025)#2109
Open
bruschill wants to merge 1 commit into
Open
fix(device-config): surface and migrate deprecated Repeater role (#2025)#2109bruschill wants to merge 1 commit into
bruschill wants to merge 1 commit into
Conversation
…htastic#2025) Existing nodes reporting the deprecated REPEATER role (rawValue 4) had no DeviceRoles case, so DeviceRoles(rawValue: 4) returned nil — the role could not be displayed and the node could not be safely reconfigured. - Add a deprecated .repeater case so reads resolve everywhere (node detail, node list, settings) as "Repeater (Deprecated)". - Add DeviceRoles.isDeprecated; hide deprecated roles from new selection in the Device Config picker, but keep the current role visible so an existing repeater node can be seen and switched to a supported role. - Show a migration hint guiding users to a Router-based role. - Update enum tests for the new case and deprecation flag.
Contributor
📝 WalkthroughWalkthroughAdds the deprecated ChangesRepeater role migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ExistingNode
participant DeviceRoles
participant DeviceConfig
participant User
ExistingNode->>DeviceRoles: Reports role raw value 4
DeviceRoles->>DeviceConfig: Decodes as .repeater
DeviceConfig->>DeviceRoles: Filters deprecated roles
DeviceRoles-->>DeviceConfig: Keeps current repeater role visible
DeviceConfig->>User: Shows deprecated warning and router migration guidance
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Added handling for the deprecated
REPEATERdevice role (Config.DeviceConfig.Role.repeater, rawValue4), which previously had noDeviceRolesenum case — soDeviceRoles(rawValue: 4)returnednileverywhere.DeviceEnums.swift: added a deprecatedcase repeater = 4(name "Repeater (Deprecated)", migration-oriented description,wifi.routericon,protoEnumValue()→.repeater) and a computedvar isDeprecated.DeviceConfig.swift: the role picker now iteratesavailableDeviceRoles=allCases.filter { !$0.isDeprecated || $0.rawValue == deviceRole }, hiding deprecated roles from new selection while keeping the currently-set role visible so an existing repeater node can be seen and reconfigured. Added an orange warning label guiding the user to a Router-based role.docs/user/settings.mdand regenerated the bundled docs.allCases.count11 → 12 in both suites) and added coverage for the.repeatercase /isDeprecated.Fixes #2025
Why did it change?
Existing nodes still reporting
REPEATERcould not be displayed (role showed as "Unknown") and could not be safely reconfigured — and opening their Device Config and saving would crash on the force-unwrap in the save path. This surfaces the role and provides a migration path to a Router-based role, mirroring Android (filtered from new selection, but visible for existing nodes).How is this tested?
EnumComprehensiveTests.swiftandLoraDeviceEnumTests.swift(case count, rawValue,isDeprecated, and that repeater is the only deprecated role).Screenshots/Videos (when applicable)
N/A
Checklist
docs/user/ordocs/developer/, and updated accordingly — added a deprecated-Repeater note todocs/user/settings.mdand regenerated the bundled docs underMeshtastic/Resources/docs/.