Skip to content

fix: align channel QR share contract#6325

Merged
jamesarich merged 2 commits into
meshtastic:mainfrom
RCGV1:codex/fix-channel-qr-contract
Jul 21, 2026
Merged

fix: align channel QR share contract#6325
jamesarich merged 2 commits into
meshtastic:mainfrom
RCGV1:codex/fix-channel-qr-contract

Conversation

@RCGV1

@RCGV1 RCGV1 commented Jul 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Default channel QR sharing to Replace.
  • Serialize an explicit Add URL from a ChannelSet without lora_config, while retaining ?add=true.
  • Cover raw-payload and parser round trips for Replace and Add across all supported channel counts (1-8).
  • Bind the screen's initial share state to the URL passed to QrDialog, with a focused Replace-flow regression test.

Deliberately Out Of Scope

This is the first focused contract change only. Channel-capacity and duplicate conflict UX, a unified intake/share workflow, system share or deep-link entry points, and reboot/resync handling remain tracked in #6324.

Validation

:core:model:jvmTest :feature:settings:jvmTest \
  --tests org.meshtastic.core.model.util.ChannelSetUrlTest \
  --tests org.meshtastic.feature.settings.radio.channel.ChannelScreenTest \
  spotlessCheck detekt

Passed locally with Homebrew OpenJDK 25 and the Android command-line tools configured.

Refs meshtastic/design#128
Refs #6324

Summary by CodeRabbit

  • New Features
    • Improved channel sharing with clearer Replace and Add options.
    • Add-mode share links now preserve channel settings without unnecessarily retuning radio configuration.
    • Replace-mode links continue to retain the complete channel configuration.
  • Bug Fixes
    • Fixed shared channel URLs so they correctly reflect the selected sharing mode and preserve supported channel settings.

@github-actions github-actions Bot added the bugfix PR tag label Jul 19, 2026
@coderabbitai

coderabbitai Bot commented Jul 19, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a92159a6-d643-4580-88ec-80ab818948ee

📥 Commits

Reviewing files that changed from the base of the PR and between a3fe76f and 689945c.

📒 Files selected for processing (5)
  • core/model/src/commonMain/kotlin/org/meshtastic/core/model/util/ChannelSet.kt
  • core/model/src/commonTest/kotlin/org/meshtastic/core/model/util/ChannelSetUrlTest.kt
  • feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/channel/ChannelScreen.kt
  • feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/channel/ChannelShareState.kt
  • feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/channel/ChannelScreenTest.kt

📝 Walkthrough

Walkthrough

Channel sharing now omits lora_config from Add-mode URL payloads while preserving it for Replace mode. Share selection and URI generation move into ChannelShareState, with updated settings UI wiring and tests.

Changes

Channel sharing

Layer / File(s) Summary
Channel URL payload contract
core/model/src/commonMain/kotlin/.../ChannelSet.kt, core/model/src/commonTest/kotlin/.../ChannelSetUrlTest.kt
Add-mode encoding removes lora_config; Replace-mode encoding preserves it, with tests decoding and validating both payloads.
Share state and settings UI
feature/settings/src/commonMain/kotlin/.../channel/*, feature/settings/src/commonTest/kotlin/.../channel/ChannelScreenTest.kt
ChannelShareState owns selection and URI generation, while ChannelScreen and ChannelShareDialog consume the computed URI; default Replace behavior is tested.

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

Possibly related issues

  • meshtastic/Meshtastic-Android issue 6324 — Covers the same Replace/Add URL contract and lora_config handling.
  • meshtastic/device-ui issue 350 — Addresses matching ChannelSet QR sharing semantics.
  • meshtastic/web issue 1313 — Defines the shared Replace/Add URL behavior.
  • meshtastic/Meshtastic-Apple issue 2126 — Covers omission of lora_config in Add URLs.
  • meshtastic/design issue 128 — Describes the Replace/Add channel-sharing contract.

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: jamesarich

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating the channel QR sharing contract and related behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@RCGV1
RCGV1 marked this pull request as ready for review July 19, 2026 22:01
@jamesarich
jamesarich added this pull request to the merge queue Jul 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 21, 2026
@jamesarich
jamesarich added this pull request to the merge queue Jul 21, 2026
@jamesarich
jamesarich removed this pull request from the merge queue due to the queue being cleared Jul 21, 2026
@jamesarich
jamesarich merged commit 79f1124 into meshtastic:main Jul 21, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants