Conversation
…tion Two fixes for buzz-pair source → mobile app credential import: 1. CLI (buzz-pairing-cli): resolve_payload() was sending a raw nsec string as the payload, but the mobile app's _processPayload() expects a JSON object with relayUrl, pubkey, and nsec fields. Changed to construct the proper JSON payload matching the mobile app's expected format. 2. Mobile (pairing_provider.dart): _validateRelayUrl() rejected ws:// and wss:// URL schemes, only accepting http/https. Added ws/wss to allowed schemes since the CLI sends the relay URL with its native ws:// prefix. Fixes block#4744 Signed-off-by: yash101017 <yashpatel0017@gmail.com>
This branch has not been deployed
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.
Problem
Running
buzz-pair source --relay ws://<relay>:3000and scanning the QR code with the Buzz mobile app resulted in:Root Cause (two bugs)
Bug 1: CLI sends raw nsec, mobile expects JSON object
buzz-pairing-cli::resolve_payload()was sending the nsec as a raw bech32 string:{"type":"payload","payload_type":"nsec","payload":"nsec1abc..."}But
_processPayload()in the mobile app callsjsonDecode(payload)expecting:{"relayUrl":"ws://...","pubkey":"...","nsec":"nsec1..."}jsonDecode("nsec1abc...")throwsFormatExceptionbecausenis not valid JSON.Fix:
resolve_payload()now constructs a JSON object withrelayUrl,pubkey, andnsecfields.Bug 2: Mobile app rejects ws:// relay URLs
_validateRelayUrl()only acceptedhttp/https, rejectingws:///wss://.Fix: Added
wsandwssto allowed URL schemes.Files Changed
crates/buzz-pairing-cli/src/main.rs— resolve_payload constructs JSON payloadmobile/lib/features/pairing/pairing_provider.dart— accept ws/wss URL schemesTesting
End-to-end on Android with Tailscale relay — pairing completes successfully.
Fixes #4744