Skip to content

[Swift][Bug]: Add missing ecp params to checkout URLs in CheckoutViewController - #649

Open
kieran-osgood-shopify wants to merge 2 commits into
ko/swift-sample-checkout-presentationfrom
ko/fix-swift-checkout-url-decoration-1215
Open

kieran-osgood-shopify wants to merge 2 commits into
ko/swift-sample-checkout-presentationfrom
ko/fix-swift-checkout-url-decoration-1215

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

CheckoutViewController is public. It is missing the ecp query params so it never subscribes to protocol.

All API's route through CheckoutViewController, and decorate the url before instantiating it

This PR moves the decoration logic into CheckoutViewController, so all paths are covered equally.

Fixes shop/issues-checkout-kit#1215.

What changes are you making?

This change:

  • decorates URLs in the public and accelerated-checkout CheckoutViewController initializers
  • removes redundant decoration from UIKit convenience presentation and SwiftUI
  • preserves preload as its own decoration boundary
  • adds coverage for every URL entrypoint, managed query parameter replacement, and idempotence
  • lets a directly constructed CheckoutViewController reuse a checkout preloaded from the same undecorated URL, because both now resolve to the same decorated URL
image image

How to test

The Swift demo app's CheckoutDelegate.checkoutDidStart(_:) handler logs [CheckoutKitSwiftDemo] Started: <checkout id>. Checkout Kit calls it only when it receives the Embedded Checkout Protocol ec.start notification, so the Started: log line means ec.start was received.

GIVEN the Swift demo app is running from this PR's branch on a simulator

AND Settings → Features → Checkout presentation is set to UIKit, so the Cart tab presents a directly constructed CheckoutViewController

AND Settings → Features → Checkout preloading is disabled

WHEN you add a product, open the Cart tab and tap Check out

THEN the Xcode console logs [CheckoutKitSwiftDemo] Started: gid://shopify/Checkout/… once checkout loads, confirming that ec.start was received

AND checkout opens without the store header or the Information › Shipping › Payment › Review breadcrumbs


GIVEN the Swift demo app is running from the base branch (#775) on a simulator

AND Settings → Features → Checkout presentation is set to UIKit

AND Settings → Features → Checkout preloading is disabled

WHEN you add a product, open the Cart tab and tap Check out

THEN checkout loads, but the console never logs Started:, because ec.start is never received

AND checkout shows the store header and the step breadcrumbs

Closing checkout logs Dismissed on both branches, because it comes from the native close button rather than the protocol.

No order needs to be placed.


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

README changes are not required because the documented presentation APIs and usage remain unchanged.


Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Embedded Checkout Protocol version?
  • I have bumped embeddedCheckoutProtocolAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated protocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.api if the public API changed
Releasing a new Android version?
  • I have bumped checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Aug 14, 2026
@kieran-osgood-shopify kieran-osgood-shopify changed the title Decorate checkout URLs in CheckoutViewController [Swift][Bug]: Add missing ecp params to checkout URLs in CheckoutViewController Sep 14, 2026
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the ko/fix-swift-checkout-url-decoration-1215 branch from dd7d82d to 0d0b337 Compare September 14, 2026 14:45
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from main to ko/swift-sample-checkout-presentation September 14, 2026 14:46
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #776 September 14, 2026 14:46
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the ko/fix-swift-checkout-url-decoration-1215 branch from 0d0b337 to 5c1427f Compare October 6, 2026 14:32
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Bundle Size Budgets

Budget Size Limits Result
— — — ➖ No configured budgets affected

Bundle and package size

Web bundle sizes cover shipped runtime JavaScript. Package sizes cover the full published archive, including any source maps, declarations, and documentation it contains.

Platform Measurement Compression Base Head Delta
- - - - - -
How sizes are measured

Measured from the PR base SHA and PR head SHA. Web bundle rows sum shipped .js, .mjs, and .cjs files under dist/, excluding source maps and declarations. The gzip bundle size sums files compressed individually with gzip -n -9. npm package sizes are gzip-compressed .tgz archives; Android AAR sizes are ZIP archives. Package sizes are not final app binary sizes.

@kieran-osgood-shopify
kieran-osgood-shopify marked this pull request as ready for review October 7, 2026 10:35
@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner October 7, 2026 10:35
@bitrise

bitrise Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Bitrise builds

E2E · iOS CI

Install this build

Open Tophat, select your target device, then click Install. Links open on the Mac running Tophat.

SDK Install
Swift Install with Tophat

Checkout Kit E2E results

Status Tags Target Platform OS version tag Device
❌ launch, checkout-presentation, checkout-completion, buyer-identity, preload swift ios latest iPhone 15
iOS 27 Beta

Failures

Caution

If you believe an assertion is flaky, please raise a ticket in the #checkout-kit-devs channel so it can be addressed.

BrowserStack artifacts require BrowserStack access. Sign in to BrowserStack App Automate before opening artifact links.

iOS — swift

Test Status Artifacts
./tests/shared/checkout-guest ❌ BrowserStack · Video · Screenshot · Maestro commands · Maestro log

This branch has not been deployed

No deployments
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.

2 participants