Skip to content

[BUG] Stripe Connect Embedded Components - AccountOnboardingController #6721

Description

@Opryatnov

Summary

AccountOnboardingControllerDelegate.accountOnboardingDidExit(_:) is not called after the first automatic or manual dismissal of the onboarding flow.

accountOnboardingDidExit(_:) is invoked inconsistently. In most cases it is called correctly, but occasionally it is not called even though the onboarding UI has been dismissed. This has been observed after both automatic dismissal (after pressing Confirm) and manual dismissal using the close button.

If the onboarding flow is opened again, the delegate callback works correctly on every subsequent dismissal.

Manual dismissal using the close ("X") button always triggers accountOnboardingDidExit(_:).

Code to reproduce

let session = try await networkLayer.getVerificationAccountSession()

let apiClient = STPAPIClient(
    publishableKey: session.publishableKey
)

let componentManager = EmbeddedComponentManager(apiClient: apiClient) {
    try await networkLayer.getVerificationAccountSession().clientSecret
}

self.componentManager = componentManager

let onboardingController = componentManager.createAccountOnboardingController()
onboardingController.delegate = self
onboardingController.title = "Verification"

onboardingController.present(from: self)

Delegate:

extension ViewController: AccountOnboardingControllerDelegate {

    func accountOnboardingDidExit(_ accountOnboarding: AccountOnboardingController) {
        print("EXIT")
    }

    func accountOnboarding(
        _ accountOnboarding: AccountOnboardingController,
        didFailLoadWithError error: Error
    ) {
        print(error)
    }
}

Reproduction steps

  1. Present AccountOnboardingController.
  2. Complete the onboarding flow.
  3. Press Confirm.
  4. Stripe automatically dismisses the onboarding UI.
  5. Observe that accountOnboardingDidExit(_:) is not called.
  6. Present the onboarding controller again.
  7. Complete or close the onboarding.
  8. accountOnboardingDidExit(_:) is now called correctly.

iOS version

iOS 18.5

Installation method

Swift Package Manager (SPM)

SDK version

Stripe iOS SDK 26.2.0

Other information

  • The delegate is assigned before calling present(from:).
  • The presenting UIViewController remains the same.
  • No errors are reported.
  • The application does not enter the background during the onboarding flow.
  • The issue only happens on the first automatic/manual dismissal after pressing Confirm or pressing Close.
  • Manual dismissal using the navigation bar close button always invokes accountOnboardingDidExit(_:).
  • Subsequent presentations of AccountOnboardingController work as expected.

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