Fix WKNavigationDelegate policy signatures#320
Open
kieran-osgood-shopify wants to merge 1 commit into
Open
Conversation
markmur
approved these changes
Jun 23, 2026
Assisted-By: devx/058cd5b9-f1cc-431b-b520-15657ace50f1
b060e6d to
058ec1e
Compare
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?
Fix the Swift
WKNavigationDelegatepolicy callback signatures onCheckoutWebViewso they match the current WebKit protocol requirements.The existing methods were missing
@MainActor @Sendableon thedecisionHandlerclosure, so Swift warned that they only "nearly" matched the optionalWKNavigationDelegaterequirements. That means WebKit may not dispatch navigation action/response policy callbacks to the SDK at runtime, even though direct unit tests that call the methods still pass.This also enables warnings-as-errors for the shipped Swift package targets only:
ShopifyCheckoutProtocolShopifyCheckoutKitShopifyAcceleratedCheckoutsThat keeps this guardrail focused on our library code instead of test-only dependencies like
ViewInspector. To use SwiftPM's first-class.treatAllWarnings(as: .error)setting, the manifest tools version is bumped from 6.0 to 6.2.Why?
The checkout HTTP error handling path depends on
webView(_:decidePolicyFor:decisionHandler:)for navigation responses callinghandleResponse(_:). If WebKit does not see the selector as implemented, 4xx/5xx checkout responses can render or leave the sheet blank instead of flowing through the SDK's intended error handling.Existing tests did not fail because they call
handleResponse(_:)or the Swift methods directly, bypassing Objective-C optional-protocol selector dispatch. This PR adds a regression test that checks theCheckoutWebViewinstance responds to the WebKit policy selectors.Enabling warnings-as-errors on the package library targets would have caught the original warning at build time while avoiding noise from test targets and third-party test dependencies.
How to test
shadowenv exec -- env CURRENT_SIMULATOR_UUID=48B8B315-0429-4EB2-A482-F5223CBD96D7 platforms/swift/Scripts/xcode_run test ShopifyCheckoutKit-Package CheckoutWebViewTestsshadowenv exec -- env CURRENT_SIMULATOR_UUID=48B8B315-0429-4EB2-A482-F5223CBD96D7 /opt/dev/bin/dev swift build packagesshadowenv exec -- /opt/dev/bin/dev swift lintshadowenv exec -- env CURRENT_SIMULATOR_UUID=48B8B315-0429-4EB2-A482-F5223CBD96D7 /opt/dev/bin/dev swift testBefore you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
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.