Skip to content

Swift/Kotlin alignment: discard preload cache on configuration changes - #680

Open
kieran-osgood-shopify wants to merge 1 commit into
kieran-osgood/08-20-fixswiftuimodifiersshouldbeinstancescopedfrom
preload-configuration-invalidation
Open

Swift/Kotlin alignment: discard preload cache on configuration changes#680
kieran-osgood-shopify wants to merge 1 commit into
kieran-osgood/08-20-fixswiftuimodifiersshouldbeinstancescopedfrom
preload-configuration-invalidation

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

TLDR

This PR fixes a bug in swifts preload cache invalidation after configuration changes, as well as aligns the implementation otherwise to Kotlins

Details

I observed a fork in behaviour between Swift and Kotlin

Kotlin discards the CheckoutWebView cache on each configuration change (ShopifyCheckoutKit.configure {})
Swift only invalidated after configuration changes if preloading had changed

Thats the divergent behaviour

The bug is that other properties in configuration drive behaviour of preload, not responding to these means the preload is actually stale

  • appearance (visual)
  • platform (drives user agent)

Approach Rationale

I considered updating the swift side to additionally check for appearance and storefront changes to keep this atomic, however opted to match to kotlins for these reason:

  • Documenting this behaviour for consumers is easier: "ShopifyCheckoutKit.configure {} calls / direct mutation via ShopifyCheckoutKit.configuration will always discard preloaded checkouts"
  • Avoids stale case bug where we add another property to configuration that preload relies on and isn't keyed on for invalidation

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)

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.

@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner August 19, 2026 15:04
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Aug 19, 2026
@kieran-osgood-shopify kieran-osgood-shopify changed the title fix: discard preload cache on swift configuration changes Swift/Kotlin alignment: discard preload cache on swift configuration changes Aug 19, 2026
@kieran-osgood-shopify kieran-osgood-shopify changed the title Swift/Kotlin alignment: discard preload cache on swift configuration changes Swift/Kotlin alignment: discard preload cache on configuration changes Aug 19, 2026
@github-actions

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Android release AAR 291.2 KiB 291.2 KiB -1 B
Android file breakdown
File Base Head Delta
classes.jar 308.4 KiB 308.4 KiB +1 B
res/layout/checkout_view_content.xml 2.6 KiB 2.6 KiB 0 B
res/layout/checkout_sheet_content.xml 2.0 KiB 2.0 KiB 0 B
res/values/values.xml 1.3 KiB 1.3 KiB 0 B
R.txt 1.2 KiB 1.2 KiB 0 B
AndroidManifest.xml 922 B 922 B 0 B
proguard.txt 798 B 798 B 0 B
res/drawable/close.xml 431 B 431 B 0 B
res/menu/checkout_menu.xml 354 B 354 B 0 B
META-INF/com/android/build/gradle/aar-metadata.properties 157 B 157 B 0 B

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.

@bitrise

bitrise Bot commented Aug 19, 2026

Copy link
Copy Markdown

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
Kotlin Install with Tophat

Checkout Kit E2E results

Status Suite Target Platform OS version tag Device
kotlin-android kotlin android latest Google Pixel 9
Android 17.0
swift-ios swift ios latest iPhone 15
iOS 27 Beta

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the preload-configuration-invalidation branch from 9280826 to d50a79a Compare August 19, 2026 15:53
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from main to graphite-base/680 August 20, 2026 10:44
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the preload-configuration-invalidation branch from d50a79a to 2269a24 Compare August 20, 2026 10:44
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from graphite-base/680 to kieran-osgood/08-20-fixswiftuimodifiersshouldbeinstancescoped August 20, 2026 10:44

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the preload-configuration-invalidation branch from 2d32510 to a9f5fd4 Compare August 20, 2026 11:57
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