Skip to content

fix(android-sample): let a guest cart take the shop market - #570

Draft
kieran-osgood-shopify wants to merge 1 commit into
graphite-base/570from
kieran-osgood/android-guest-cart-market
Draft

fix(android-sample): let a guest cart take the shop market#570
kieran-osgood-shopify wants to merge 1 commit into
graphite-base/570from
kieran-osgood/android-guest-cart-market

Conversation

@kieran-osgood-shopify

Copy link
Copy Markdown
Contributor

What

The Android sample gives a guest cart a hardcoded Canadian buyer identity. This removes it, so
a guest cart takes the market of the shop, like the Swift and React Native samples already do.

- buyerIdentity = Optional.present(CartBuyerIdentityInput(countryCode = Optional.present(CountryCode.CA)))
+ buyerIdentity = Optional.Absent

Why

A country on the buyer identity picks the market. The market decides the currency, the address
form, and the labels on its fields. So the Android sample rendered a Canadian checkout, while
the shared E2E fixture types a United States address.

That is fault B4 in e2e/FLAKES.md: checkout-guest failed on Kotlin Android at
Scrolling DOWN until "Country/Region" is visible, and passed on React Native Android.

Evidence from the two BrowserStack Maestro logs:

Target Country/Region node Result
Kotlin Android Bounds(x=34, y=336, width=1010, height=0), unchanged over 6 swipes fail after 127s
React Native Android Bounds(x=34, y=1202, width=1010, height=134) pass

React Native also skipped the country picker step, because United States was already
selected. The Kotlin failure screenshot shows a total in CAD.

The three samples now agree:

Sample Guest cart buyer identity
Swift Storefront.CartInput(lines: lines)
React Native {}
Kotlin Optional.Absent

Scope

This changes the sample app only. It does not touch the published com.shopify:checkout-kit
library, so it has no consumer impact.

The demo buyer identity and the signed-in customer paths are unchanged. Only the guest path
loses the country.

Test

Written first, and confirmed red before the fix:

@Test
fun `a guest supplies no buyer identity`() {
    val input = cartInput(demoBuyerIdentityEnabled = false, customerAccessToken = null)

    assertThat(input.buyerIdentity.getOrNull()).isNull()
}
Check Result
dev android test BUILD SUCCESSFUL, 36 tests
dev android lint BUILD SUCCESSFUL

🤖 Generated with Claude Code

The Android sample gave a guest cart a Canadian buyer identity. A country on
the buyer identity picks the market, and the market decides the currency, the
address form and its labels, so the Kotlin checkout rendered a Canadian form
and totalled in CAD.

The Swift and React Native samples send no buyer identity for a guest, so this
one now sends none either. This is flake B4: the shared E2E fixture is a United
States address, and checkout-guest failed on Kotlin Android while React Native
Android passed the same test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/5b4b8d5b-690a-4389-841e-039723ade1da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant