Skip to content

swift-example-app: invite link is dropped when no wallet exists #5089

Open

Description

@QuantumExplorer

Expected Behavior

Opening a dashpay://invite link before any wallet exists keeps the link, and the claim sheet opens once a wallet is created or selected. This is what the Android example app does (DashPayTabScreen.kt, around lines 155-158, keeps the link parked until a wallet exists).

Current Behavior

The iOS example app drops the link. In packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/DashPay/DashPayTabView.swift (around lines 149-153):

guard let urlString = appUIState.pendingInviteURL else { return }
appUIState.pendingInviteURL = nil
guard let walletId = claimWalletId else { return }

pendingInviteURL is cleared before the wallet check returns, so with no wallet the invite is lost and the user has to open the link again.

Possible Solution

Check claimWalletId before clearing pendingInviteURL, and re-run the consume step when a wallet becomes available (the view already re-consumes on invitationClaimInFlight changes). Keep clearing the URL as soon as it is handed to the claim sheet, since it is a bearer secret.

Steps to Reproduce (for bugs)

  1. Fresh install of SwiftExampleApp, no wallet.
  2. Open a dashpay://invite?... link.
  3. Create a wallet. The claim sheet never appears.

Context

Found while checking the committed DashPay QA spec removed in #5060 against the code.

Your Environment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions