Skip to content

platform-wallet: a funded invitation whose record fails to save cannot be recovered #5088

Open

Description

@QuantumExplorer

Expected Behavior

When an invitation voucher is funded but its record cannot be saved, the host still gets the funding outpoint, so it can show the invitation under Sent invitations and let the user reclaim it.

Current Behavior

The funds are locked in the voucher, but neither host can find or reclaim them:

  • create_invitation returns PlatformWalletError::AssetLockTransaction with a message and no outpoint (packages/rs-platform-wallet/src/wallet/identity/network/invitation.rs, the persister.store(...).and_then(flush) error around line 330). The message itself says the voucher "would be missing from Sent invitations and unreclaimable".
  • The FFI writes out_outpoint only on success (packages/rs-platform-wallet-ffi/src/invitation.rs, around line 215), so Swift and Kotlin never learn which outpoint was funded.

Possible Solution

Carry the outpoint in the error (a dedicated variant, or fill out_outpoint before returning the persist failure) so the host can keep a local record, retry the persist, or offer reclaim. A test can force the persister to fail after funding and assert the outpoint reaches the caller.

Steps to Reproduce (for bugs)

  1. Create an invitation with a persister whose store or flush fails after the asset lock is broadcast.
  2. Observe the error: it has no outpoint, and the invitation is absent from Sent invitations on iOS and Android.

Context

Found while checking the committed DashPay specs removed in #5060 against the code; the Kotlin invitations spec listed it as open.

Your Environment

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions