[Protocol] Adopt UCP 2026-08-25 across Checkout Kit - #794
adrian-augustyn wants to merge 1 commit into
Conversation
Assisted-By: devx/9ecb7751-82f9-4062-885f-a23b95dfc4a7
Package Size
Web file breakdown
React Native file breakdown
Android 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
|
| it("replaces caller-supplied ec_* parameters", () => { | ||
| const checkout = renderCheckout({ | ||
| src: "https://example.com/checkout?ec_version=stale&ec_delegate=custom", | ||
| src: "https://example.com/checkout?ec_version=2026-04-08&ec_version=stale&ec_delegate=custom", |
There was a problem hiding this comment.
This looks a bit weird. We don't need two instances of ec_version in the URL for this test
|
|
||
| const url = new URL(expectWindowOpenArgs(windowOpenSpy)[0] as string); | ||
| expect(url.searchParams.getAll("ec_version")).toEqual([EMBED_PROTOCOL_VERSION]); | ||
| expect(url.searchParams.getAll("ec_version")).toEqual(["2026-08-25"]); |
There was a problem hiding this comment.
The variable was arguably better here
| let twice = CheckoutURLDecorator.decorate(once, configuration: configuration) | ||
| let items = queryItems(twice) | ||
|
|
||
| #expect(items.filter { $0.name == "ec_version" }.map(\.value) == ["2026-08-25"]) |
There was a problem hiding this comment.
Can we read this from the protocol lib directly? One less thing to update when we upgrade next time
| configuration.appearance = .app(.light) | ||
|
|
||
| let url = try #require(URL(string: "https://shop.com/cart/c/abc?ck_branding=app&ec_color_scheme=dark")) | ||
| let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_version=2026-04-08&ec_version=stale&ck_branding=app&ec_color_scheme=dark")) |
There was a problem hiding this comment.
We don't need two instances of ec_version here either
| @@ -1,3 +1,4 @@ | |||
| // April wire payloads are retained here as older-version compatibility coverage. | |||
There was a problem hiding this comment.
This sound wrong;
- We can drop the comment
- Test coverage should cover the pinned version holistically
|
|
||
| @Test | ||
| fun `checkout model decodes extension fields`() { | ||
| fun `April checkout model decodes extension fields`() { |
There was a problem hiding this comment.
We can drop references to "April model" everywhere
| @Test | ||
| fun `decorate replaces caller-supplied supported ECP params and strips unsupported ECP params`() { | ||
| val url = "$BASE_URL?ec_version=override&ec_delegate=custom&ec_auth=token&ec_color_scheme=dark&ck_branding=app" | ||
| val url = "$BASE_URL?ec_version=2026-04-08&ec_version=stale&ec_delegate=custom&ec_auth=token&ec_color_scheme=dark&ck_branding=app" |
There was a problem hiding this comment.
Drop duplicative params here
| val url = "$BASE_URL?ec_version=2026-04-08&ec_version=stale&ec_delegate=custom&ec_auth=token&ec_color_scheme=dark&ck_branding=app" | ||
| val result = CheckoutUrlDecorator.decorate(url).toUri() | ||
| assertThat(result.getQueryParameters("ec_version")).containsExactly(CheckoutProtocol.SPEC_VERSION) | ||
| assertThat(result.getQueryParameters("ec_version")).containsExactly("2026-08-25") |
There was a problem hiding this comment.
Pinned static version here was better
| import org.assertj.core.api.Assertions.assertThat | ||
| import org.junit.Test | ||
|
|
||
| // April wire payloads are retained here as older-version compatibility coverage. |
What changes are you making?
Checkout-web already understands UCP August when a client asks for it. Before this change, Checkout Kit still asked for April and used models generated from the April specification. This PR updates the Checkout Kit side: Web, Swift, and Android request
2026-08-25, and their generated models understand the August response.The change also keeps focused support for older April messages that Checkout Kit may still encounter. This is compatibility when reading JSON from checkout-web; it does not mean that every application using the generated models will compile unchanged. This PR does not publish packages or change released dependency versions.
ucp@v2026-08-25, resolved tocd78fb38e819de77d9b527d110476eccb876f1bd.What changed?
ec_version=2026-08-25in the checkout URL. Checkout Kit replaces older or duplicate values already present in that URL.Measure,ConstraintExpression, andConstraintProperty. They also ensure Swift and Kotlin retain business-specific JSON fields where the protocol allows them. Generation stops with a clear error if an upstream change invalidates any of these assumptions.FulfillmentOption.descriptionand convert it to the currentDescriptionobject withplainset. Encoding that value again produces{ "plain": "…" }; it does not recreate the old string form.The separate public-event redesign in #748 is not part of this change.
Compatibility and public API impact
Compatibility tests run the same example April and August checkout messages through TypeScript, Swift, and Kotlin. Those examples decode successfully. This does not prove that every historical message works, or that code using the generated models will compile without changes.
map_order, structured descriptions, business-location destinations, and new fulfillment values such asdrone_delivery.typefield added in August, and old description strings becomeDescription.plain.shippingandpickup. Code that directly uses the old enum cases or exhaustive switches must change.FulfillmentOption.descriptionchanges from a string to the structuredDescriptiontype.copyfunctions, and component functions change where August adds fields.ConstraintExpressionandConstraintProperty.These source changes affect code that directly constructs or inspects the generated protocol models. Applications using only higher-level Checkout Kit APIs may be unaffected.
Swift and Kotlin protocol API reports were regenerated and reviewed. The Android Checkout Kit API, other Swift module reports, React Native API report, published native SDK pointers, and release coordinates remain unchanged.
How was this tested?
Local verification for this change includes:
git diff --checkpasses.The all-in-one
dev protocol checkreaches its standalone macOS Swift test, compiles successfully, and then exits without diagnostics because of a local test-runner problem. The same Swift compatibility and package suites pass through the simulator-backed runner.Where should reviewers focus?
protocol/scripts/.The 99 pinned schema files are an upstream import rather than hand-written Checkout Kit code.
dev protocol check-upstreamverifies that they exactly match the selected UCP commit.Merge requirements
2026-08-25; rendering through the April fallback is not sufficient evidence.Package publication and release coordination happen separately from this PR.
Supersedes #765, which contains the initial review discussion. The branch was moved into
Shopify/checkout-kitso the repository's full CI can run.