feat: incoming message origin validation for react native - #477
feat: incoming message origin validation for react native#477michaeljsXu wants to merge 6 commits into
Conversation
4fc84ea to
3d231ce
Compare
a5483f8 to
f5614eb
Compare
f3cbfbc to
a23236f
Compare
f5614eb to
3be5ff9
Compare
a23236f to
7a8303d
Compare
3be5ff9 to
3c1706a
Compare
7a8303d to
194c4cb
Compare
3c1706a to
336928d
Compare
194c4cb to
9b666d9
Compare
336928d to
6032726
Compare
9b666d9 to
a989701
Compare
c05fb85 to
eb60315
Compare
a989701 to
3f57e0a
Compare
eb60315 to
1f34aef
Compare
3f57e0a to
11a49d2
Compare
1f34aef to
4b6d715
Compare
3c28064 to
2110ba0
Compare
4b6d715 to
48ff991
Compare
2110ba0 to
c94b042
Compare
48ff991 to
5af0ce4
Compare
5af0ce4 to
4b14f6c
Compare
Package Size
React Native file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
There was a problem hiding this comment.
I don’t think listener ownership should be encoded as checkout configuration. hasMessageRejectedCallback is bridge implementation state rather than checkout configuration, and coupling the two makes unrelated updates destructive.
The configuration behaviour is a little inconsistent in its current state. Omitting the title, preloading, or allowedMessageOrigins attributes preserve their current native values, while omitting onMessageRejected clears it.
Could we manage the event bridge through a dedicated lifecycle method instead?
RNShopifyCheckoutKit.setMessageRejectedListenerEnabled(true);### What changes are you making? Expose `allowedMessageOrigins` through the React Native configuration and round-trip it across both native bridges. Rejections are logged as warnings by the native SDKs (#646, #647); there is no JavaScript callback. Bumps the native SDK pins to `4.0.0-alpha.5` — the first release with warn-level rejection logging and without `onMessageRejected` — and regenerates both Podfile.locks against the published pods. Replaces #477. ### How to test From `platforms/react-native`: ```sh pnpm test modules/@shopify/checkout-kit-react-native/tests/index.test.ts --runInBand pnpm module typecheck pnpm module api:dump ```

What changes are you making?
Expose
allowedMessageOriginsand a typedonMessageRejectedcallback through the React Native API. The callback remains in JavaScript while serializable configuration crosses the native bridge, supports replacement and removal, and is cleaned up byteardown().Both native bridges emit the same
{origin, message, reason}payload, andgetConfig()round-trips configured origins and the current JavaScript callback.How to test
From
platforms/react-native:pnpm test modules/@shopify/checkout-kit-react-native/tests/index.test.ts --runInBand pnpm module typecheck pnpm module api:dump