Skip to content

[Android] Scope preload state to per-cache entry - #455

Closed
markmur wants to merge 1 commit into
android-preload-observabilityfrom
android-preload-per-entry
Closed

[Android] Scope preload state to per-cache entry#455
markmur wants to merge 1 commit into
android-preload-observabilityfrom
android-preload-per-entry

Conversation

@markmur

@markmur markmur commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Promotes preload lifecycle state from cache-global to per-cache-entry, so each CheckoutPreload handle reflects only the checkout it preloaded rather than a shared singleton state. The Entry now owns its state and weak observer; the cache keeps a keyed handles registry and transitions are view-guarded, so a navigation/error/eviction callback only mutates the entry that fired it. The cache stays single-slot today, but this removes the last cache-global coupling and is forward-compatible with a future multi-entry keyed cache.

This is the Android port of #454 (Swift). Android has no keep-alive or scheduled-expiry timers, so this is a strict subset — only state + observer move onto the entry; expiry stays lazy in take().

Public API is unchanged (apiCheck clean). See distinct keys observe independently in PreloadObservabilityTest for the behavior that regressed under the old shared-state model.

markmur commented Jul 14, 2026

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.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.85% (327/356) 87.98% (183/208) 100% (86/86)

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Android release AAR 250.1 KiB 250.9 KiB +784 B
Android file breakdown
File Base Head Delta
classes.jar 265.5 KiB 266.5 KiB +1022 B
res/layout/checkout_view_content.xml 2.2 KiB 2.2 KiB 0 B
res/layout/checkout_sheet_content.xml 2.0 KiB 2.0 KiB 0 B
res/values/values.xml 1.2 KiB 1.2 KiB 0 B
R.txt 1.1 KiB 1.1 KiB 0 B
proguard.txt 798 B 798 B 0 B
AndroidManifest.xml 578 B 578 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.

@markmur
markmur force-pushed the android-preload-eviction branch from 4a8ed16 to b789d74 Compare July 15, 2026 12:06
@markmur
markmur force-pushed the android-preload-per-entry branch 2 times, most recently from 1e1dec2 to 0e75098 Compare July 15, 2026 12:50
@markmur
markmur force-pushed the android-preload-eviction branch 2 times, most recently from 2a9e701 to d81c123 Compare July 15, 2026 13:08
@markmur
markmur force-pushed the android-preload-per-entry branch from 0e75098 to 121486f Compare July 15, 2026 13:08
@markmur
markmur force-pushed the android-preload-eviction branch from d81c123 to ccdc8c9 Compare July 15, 2026 13:09
@markmur
markmur force-pushed the android-preload-per-entry branch from 121486f to afdb47f Compare July 15, 2026 13:09
@markmur
markmur changed the base branch from android-preload-eviction to graphite-base/455 July 15, 2026 14:42
@markmur
markmur force-pushed the android-preload-per-entry branch from afdb47f to 174d3c9 Compare July 15, 2026 14:42
@markmur
markmur force-pushed the graphite-base/455 branch from ccdc8c9 to 55ef015 Compare July 15, 2026 14:42
@markmur
markmur changed the base branch from graphite-base/455 to android-preload-observability July 15, 2026 14:42
@markmur
markmur force-pushed the android-preload-per-entry branch from 174d3c9 to 0e05590 Compare July 15, 2026 15:00
@markmur
markmur force-pushed the android-preload-observability branch 2 times, most recently from b59bb3e to 381d5ca Compare July 15, 2026 15:11
@markmur
markmur force-pushed the android-preload-per-entry branch 2 times, most recently from 1ae18db to 776e92b Compare July 15, 2026 16:01
@markmur
markmur force-pushed the android-preload-observability branch 2 times, most recently from 65a51ef to 3209276 Compare July 16, 2026 13:49
@markmur
markmur force-pushed the android-preload-per-entry branch from 776e92b to 5e26617 Compare July 16, 2026 13:49
@markmur
markmur force-pushed the android-preload-observability branch from 3209276 to ec711d4 Compare July 16, 2026 13:53
@markmur
markmur force-pushed the android-preload-per-entry branch 2 times, most recently from e1e680f to c640e93 Compare July 16, 2026 14:18
@markmur
markmur force-pushed the android-preload-observability branch from ec711d4 to 16dd07a Compare July 16, 2026 14:18
@markmur
markmur force-pushed the android-preload-per-entry branch from c640e93 to d799837 Compare July 16, 2026 15:09
@markmur
markmur force-pushed the android-preload-observability branch 2 times, most recently from 880c148 to f0af5fd Compare July 16, 2026 15:20
@markmur
markmur force-pushed the android-preload-per-entry branch 2 times, most recently from a2a3439 to 4e9e834 Compare July 16, 2026 15:48
@markmur
markmur force-pushed the android-preload-observability branch 2 times, most recently from 0c29857 to 3980889 Compare July 16, 2026 19:16
@markmur
markmur force-pushed the android-preload-per-entry branch from 4e9e834 to 391cb55 Compare July 16, 2026 19:16
@markmur
markmur force-pushed the android-preload-observability branch from 3980889 to 8410f99 Compare July 16, 2026 19:41
@markmur
markmur force-pushed the android-preload-per-entry branch from 391cb55 to 6447416 Compare July 16, 2026 19:41
@bitrise

bitrise Bot commented Jul 16, 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
React Native Install with Tophat
Swift Install with Tophat
Kotlin Install with Tophat

Checkout Kit E2E results

Status Suite Target Platform OS version tag Device
tests/shared/launch-smoke.yaml kotlin android latest Google Pixel 9
Android 17.0

@markmur
markmur force-pushed the android-preload-per-entry branch from 6447416 to e035af9 Compare July 16, 2026 20:09
@markmur
markmur changed the base branch from android-preload-observability to graphite-base/455 July 17, 2026 10:18
Assisted-By: devx/b70e7b8f-da8f-499e-b860-2d4c3524f7c5
@markmur
markmur force-pushed the android-preload-per-entry branch from e035af9 to 6a1fb1e Compare July 17, 2026 10:25
@markmur
markmur changed the base branch from graphite-base/455 to android-preload-observability July 17, 2026 10:25
@markmur

markmur commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing - deferring until we actually need multi-slot

@markmur markmur closed this Jul 17, 2026
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