Skip to content

SwiftExampleApp: hold one funding reservation from dispatch to return so an SDK rebuild never stops SPV under a Core funding #6083

Open

Description

@QuantumExplorer

Problem

The example app's SDK rebuild (network switch, Docker toggle, devnet edits) stops SPV and then replaces the wallet manager. Since #6050 it refuses before stopping SPV when the shield, Platform address or identity-registration coordinator reports a funding in flight, and those flows' submit paths refuse while a rebuild runs. Some Core-funded work is still invisible to that check:

  • AddressFundFromAssetLockCoordinator.dismiss removes a slot by wallet and recipient alone, so Done on a stale sheet can remove a newer in-flight top-up from hasInFlightFundings (the shielded coordinator already checks identity and phase).
  • SendViewModel starts a fixed-amount Core-to-shielded shield without a coordinator.
  • TransitionDetailView and ReclaimInvitationSheet call the wallet's Core-funded identity methods directly.

These calls can wait for a ChainLock with no deadline. A same-network rebuild that misses them stops the SPV client they wait on and replaces the manager, stranding the funding until the app restarts. This predates #6050; none of these calls holds the manager's native admission, so shutdown() itself does not wait for them.

Proposed

One app-level, manager-scoped reservation that every Core-funded start acquires before dispatching native work and releases when the call returns, independent of any progress UI. The rebuild checks it before stopping SPV and new fundings refuse while a rebuild is reserved. Tests: a stale dismissal during a replacement top-up, and a rebuild started during a direct Core funding.

Context

Raised in the review of #6050 (thread). Related: #6003 (shutdown cannot cancel long finality waits).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions