-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Context
When Mostro publishes orders as kind 38383 events (order event spec), the source tag contains a deep link for that order. Sites like p2p.band display these links, for example:
mostro:e215c07e-b1f9-45b0-9640-0295067ee99a?relays=wss://relay.mostro.network,wss://nos.lol
When a user opens this link on mobile with Mostro Mobile installed, the app opens the order detail directly. This works correctly when the order belongs to the currently selected Mostro instance.
Problem
Starting soon, mostrod will include its pubkey in the source tag to identify which Mostro instance published the order. Currently, the app assumes all deep links belong to the official Mostro (82fa8cb978b43c79b2156585bac2c011176a21d2aead6d9f7c575c005be88390), causing links from other Mostro instances to fail.
Proposed Solution
When the app receives a deep link with a Mostro pubkey:
Case 1: Same Mostro instance (current behavior)
If the pubkey in the deep link matches the currently selected Mostro:
- Open the order detail directly (no change needed)
Case 2: Different Mostro instance (new behavior)
If the pubkey in the deep link is different from the currently selected Mostro:
-
Show confirmation dialog:
⚠️ Different Mostro Instance This order was created on a different Mostro node: [Mostro name if available, otherwise truncated pubkey] You are currently connected to: [Current Mostro name] Do you want to switch to this Mostro and view the order? [Cancel] [Switch & View Order] -
If user confirms:
- Switch to the new Mostro instance (same logic as Settings → Select Mostro)
- Navigate directly to the order detail
- User can then take the order if desired
-
If user cancels:
- Stay on current screen
- No changes made
Implementation Notes
Deep Link Format (updated)
mostro:<order_id>?relays=<relay1>,<relay2>&mostro=<mostro_pubkey>
Or the pubkey might be included differently — coordinate with mostro daemon PR for exact format.
Files likely affected
lib/core/routes/deep_link_handler.dart(or equivalent)lib/features/settings/(Mostro switching logic)lib/features/order/(order detail navigation)
Edge Cases
- What if the Mostro pubkey is unknown (not in the user's saved nodes)?
- Option A: Add it temporarily for this session
- Option B: Prompt user to add it to their nodes first
- Option C: Reject with message "Unknown Mostro instance"
Acceptance Criteria
- Deep links with same Mostro pubkey work as before
- Deep links with different Mostro pubkey show confirmation dialog
- User can switch Mostro and view order in one flow
- User can cancel and stay on current Mostro
- Mostro name displayed in dialog if available, pubkey otherwise
- Works with relays specified in the deep link
Related
- Mostro Protocol: Order Event
- Depends on: mostrod update to include pubkey in source tag