[Android] Scope preloads to activity - #460
Draft
kiftio wants to merge 1 commit into
Draft
Conversation
11 tasks
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
11 tasks
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 14, 2026 13:40
5143f47 to
371913c
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
from
July 14, 2026 13:40
e57bb1d to
57b2d1f
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 14, 2026 14:44
371913c to
6a739e7
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
from
July 14, 2026 14:44
57b2d1f to
020fa96
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 14, 2026 15:07
6a739e7 to
f955794
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
2 times, most recently
from
July 14, 2026 15:35
c9f2ff4 to
582e6c7
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 14, 2026 15:35
f955794 to
39b0282
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
2 times, most recently
from
July 15, 2026 08:20
82a6c36 to
d89b765
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
from
July 15, 2026 08:20
582e6c7 to
88c5f9e
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 15, 2026 12:28
d89b765 to
25dff17
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
from
July 15, 2026 12:28
88c5f9e to
d00a27b
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 16, 2026 09:32
25dff17 to
221cab6
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
2 times, most recently
from
July 16, 2026 09:42
10c41e2 to
96b3980
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
2 times, most recently
from
July 16, 2026 10:23
d87d947 to
555da85
Compare
kiftio
force-pushed
the
07-14-dogfood_checkoutview_in_sample
branch
from
July 16, 2026 10:23
96b3980 to
67639e6
Compare
kiftio
changed the base branch from
07-14-dogfood_checkoutview_in_sample
to
graphite-base/460
July 16, 2026 10:33
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 16, 2026 10:41
555da85 to
5a90626
Compare
kiftio
force-pushed
the
graphite-base/460
branch
from
July 16, 2026 10:41
67639e6 to
8e2c198
Compare
kiftio
force-pushed
the
07-14-scope_preloads_to_activity
branch
from
July 16, 2026 10:42
5a90626 to
dc9b0a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changes are you making?
A preloaded
CheckoutWebViewis now only reused when theContextpassed tocheckoutViewForresolves to the sameActivityinstance that was used duringShopifyCheckoutKit.preload. Previously, the cache matched solely on URL, meaning a preloaded view could be handed to a differentActivity, leading to potential context mismatches and memory leaks.The
PreloadCachenow stores theActivityalongside the cached entry and performs a referential equality check (===) ontake. A newfindActivity()extension unwrapsContextWrapperchains to locate the backingActivity, so callers passing wrapped contexts (e.g. theme wrappers) continue to benefit from the preload cache. If the resolvedActivitydiffers from the one used during preload, or if the context has no backingActivityat all, the cached view is discarded and checkout loads normally.How to test
ActivityA, then present it from the sameActivityA— the cachedWebViewshould be reused.ActivityA, then present it from a differentActivityB— the cachedWebViewshould be discarded and a fresh load should occur.ContextWrapperwrapping the same activity — the cachedWebViewshould still be reused.Activity) — the cachedWebViewshould be discarded.checkout view consumes cached preload when context wraps preload activity,checkout view discards cached preload created by a different activity, andcheckout view discards cached preload when context has no activity.Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/README.md(major version only)Releasing a new Embedded Checkout Protocol version?
embeddedCheckoutProtocolAndroidinplatforms/android/gradle/libs.versions.tomlprotocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.apiif the public API changedReleasing a new Android version?
checkoutKitAndroidinplatforms/android/gradle/libs.versions.tomlplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.