Mark CheckoutKit UI as main actor isolated#84
Open
kieran-osgood-shopify wants to merge 1 commit into
Open
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 13, 2026
f957cbd to
82606f0
Compare
e5d6371 to
1d19f91
Compare
1d19f91 to
87179cb
Compare
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes are you making?
This is step 1 towards Swift 6 adoption.
I've marked the CheckoutKit UIKit/WebKit surfaces as
@MainActorso Swift 6 callers and implementations treat checkout UI work as main-actor isolated.There was a gotcha to work around here in the
CheckoutWebView.swift- it relied on adeinitto close the bridge.The gotcha is that in Swift 6.0 class
deinitis not isolated to the containing actor (e.g. I've marked@MainActoron class CheckoutWebView, but the deinit still runs nonisolated)There is a "nice" fix for this in Swift 6.2 but I don't want to bring the minimum compiler target up to 6.2 just yet, but it will allow us to change the declaration to be
isolated deinitwhich solves the issue for usAs a workaround for now and to avoid
MainActor.assumeIsolated(runtime failures), bridge registration is wrapped in a small helper class, that is created on the MainActor whileCheckoutWebViewis being configured.It captures a reference to the
WKUserContentControllerat that safe call site, detaches synchronously whendetachBridge()is called on the main actor, and schedules fallback teardown back ontoMainActorfrom its own deinit.How to test
Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
platforms/swift/ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/CHANGELOG.mdplatforms/swift/README.md(major version only)Releasing a new Android version?
versionNameinplatforms/android/lib/build.gradleplatforms/android/CHANGELOG.mdplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.