Skip to content

[BUG] [P1] CustomerSheet SwiftUI onCompletion block crashes with Dynamic Actor Isolation feature flag (or swift 6) enabled #5269

@BrentMifsud

Description

@BrentMifsud

Summary

When presenting the customer sheet, the onCompletion block call crashes

What is blocked by this issue?

You can't open the customer sheet

Code to reproduce

iOS version

26 Beta 4 (this would also happen on prod if using swift 6 or dynamic actor isolation feature flag)

Installation method

SPM

SDK version

24.19.0

Other information

It's happening because the onCompletion closure's actor isolation does not match the actor isolation of where it's being called.

You can probably fix it by updating the relevant closures like so, and ensuring the completion handler is called from the main actor:

public func customerSheet(
        isPresented: Binding<Bool>,
        customerSheet: CustomerSheet,
        onCompletion: @escaping @MainActor (CustomerSheet.CustomerSheetResult) -> Void
    ) -> some View {

alternatively, you can probably mark them all as nonisolated async. But since this is used in a UI context, main actor probably makes more sense.

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions