Centralize Swift checkout message ingress validation - #644
Open
markmur wants to merge 5 commits into
Open
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
markmur
force-pushed
the
swift-message-rejection-lifecycle
branch
from
August 14, 2026 11:44
63d2a15 to
ac84d8f
Compare
markmur
marked this pull request as ready for review
August 14, 2026 11:47
This was referenced Aug 14, 2026
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
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 PR explores a warning-and-drop alternative to the diagnostics subscription approach in #642 and #643. It removes
onMessageRejectedfromConfigurationwithout adding another consumer callback surface.Incoming WebKit messages now pass through an internal
CheckoutMessageIngressPolicybefore reaching the checkout protocol client:The policy owns the transport admission decision using WebKit's authenticated source origin and frame metadata. This keeps trust evaluation at the native WebView boundary and ensures the protocol client only receives admitted checkout messages.
Rejection behavior
A rejected message means that specific input was not trusted. It does not mean the checkout session failed: checkout may be displaying an external surface that also posts messages, and unrelated page activity must not be able to terminate an otherwise healthy checkout. The rejection branch logs the warning inline and returns before protocol processing begins.
PreloadStateto.failedor evict the preload.CheckoutErroror call.onFail/checkoutDidFail(error:).Consumer API
Consumers only configure the origins they trust. The existing lifecycle APIs remain reserved for actual checkout failures:
There is no message-rejection subscription in this approach. Consumers that need structured rejection telemetry can compare this PR with the diagnostics API in #642.
React Native consumer API
This approach adds no React Native event or callback. Rejected native messages are warning-logged and dropped; they do not dispatch
onFail:Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)