fix(qr): Preserve incoming channels when adding from QR#6013
Merged
jamesarich merged 1 commit intoJun 29, 2026
Conversation
QR ADD-mode used structural `.distinct()` to merge existing and incoming channel settings. Protobuf structural equality silently dropped incoming channels that matched existing entries, shifting later channels to wrong firmware indices and hiding them from the import preview. Replace `.distinct()` with an explicit append-only merge. Every existing channel is preserved at its position; every incoming channel is appended in order. The user selects which incoming channels to keep via the existing checkbox UI.
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.
Overview
This PR fixes QR ADD-mode channel preview construction so incoming channels are not silently removed before the user can review them.
The previous ADD-mode flow merged existing and incoming channels with
.distinct(). That used rawChannelSettingsstructural equality, which could remove an incoming channel before it appeared in the import preview. When that happened, later incoming channels could shift positions and the user had no way to inspect or recover the dropped entry.ADD mode should preserve the current radio channels and show incoming channels in scanned order. This change makes the preview construction explicit: existing channels stay first, and incoming channels are appended without automatic deduplication.
This follows the related QR replacement work in #5999. That PR made REPLACE imports authoritative and sequential; this PR keeps ADD-mode previews non-lossy.
Key Changes
.distinct()merging in QR ADD mode.Testing
Migration Notes