Skip to content

Add lifecycle dispatcher tests - #529

Merged
kiftio merged 1 commit into
mainfrom
07-29-add_lifecycle_dispatcher_tests
Jul 29, 2026
Merged

Add lifecycle dispatcher tests#529
kiftio merged 1 commit into
mainfrom
07-29-add_lifecycle_dispatcher_tests

Conversation

@kiftio

@kiftio kiftio commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

Adds tests to verify correct lifecycle and subscription management behavior across the React Native and Web platforms:

  • React Native: Adds tests confirming that the prior onDispatch subscription is released before a subsequent present call, and that the subscription is cleaned up after a terminal close event is received. Also adds a new test suite for dispatch-events verifying that SDK lifecycle event types are correctly recognized, that native event parity is verified only once regardless of subsequent calls, and that mismatches between native and JS event types are reported with clear error messages.
  • Web: Adds a test confirming that the protocol message listener is replaced (and the previous one aborted) on reconnect, and fully aborted on disconnect. Also adds a new test suite for the Logger utility, covering log level coercion, threshold-based message filtering, and lazy threshold evaluation.

How to test

Run the test suites for the affected platforms:

  • React Native: yarn test within the platforms/react-native module
  • Web: yarn test within the platforms/web module

Verify all new and existing tests pass without errors.


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.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Jul 29, 2026
@kiftio
kiftio marked this pull request as ready for review July 29, 2026 08:58
@kiftio
kiftio requested a review from a team as a code owner July 29, 2026 08:58
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 99%
99.2% (249/251) 85.49% (112/131) 100% (70/70)

@github-actions

github-actions Bot commented Jul 29, 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

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 65.5 KiB 65.5 KiB 0 B
React Native npm tarball 103.1 KiB 103.1 KiB 0 B
Web file breakdown
File Base Head Delta
dist/index.js.map 184.1 KiB 184.1 KiB 0 B
dist/index.d.ts 41.9 KiB 41.9 KiB 0 B
dist/custom-elements.json 40.1 KiB 40.1 KiB 0 B
dist/index.js 29.6 KiB 29.6 KiB 0 B
README.md 17.8 KiB 17.8 KiB 0 B
package.json 2.8 KiB 2.8 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B
React Native file breakdown
File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 85.4 KiB 85.4 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 53.0 KiB 53.0 KiB 0 B
ios/ShopifyCheckoutKit.swift 15.0 KiB 15.0 KiB 0 B
ios/AcceleratedCheckoutButtons.swift 14.0 KiB 14.0 KiB 0 B
lib/commonjs/index.js 13.1 KiB 13.1 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 12.9 KiB 12.9 KiB 0 B
src/index.ts 12.5 KiB 12.5 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 11.1 KiB 11.1 KiB 0 B
lib/module/index.js 10.4 KiB 10.4 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.3 KiB 10.3 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.ts 9.5 KiB 9.5 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js.map 9.1 KiB 9.1 KiB 0 B
src/index.d.ts 8.9 KiB 8.9 KiB 0 B
lib/module/index.js.map 8.2 KiB 8.2 KiB 0 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB 0 B
lib/commonjs/index.js.map 7.7 KiB 7.7 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.2 KiB 7.2 KiB 0 B
…and 110 smaller files

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 Jul 29, 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

Checkout Kit E2E results

Status Suite Target Platform OS version tag Device

Warning

Expected 2 runs, received 0 — 2 did not report. Missing runs count as failures until every run reports.

@kiftio
kiftio changed the base branch from 07-29-include_protocol_in_root_development_commands to graphite-base/529 July 29, 2026 10:07
@kiftio
kiftio force-pushed the graphite-base/529 branch from b351750 to ddc9a0e Compare July 29, 2026 10:17
@kiftio
kiftio force-pushed the 07-29-add_lifecycle_dispatcher_tests branch from 3179972 to 227fe23 Compare July 29, 2026 10:17
@kiftio
kiftio changed the base branch from graphite-base/529 to 07-29-include_protocol_in_root_development_commands July 29, 2026 10:17

kiftio commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 29, 10:37 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 29, 10:39 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 29, 10:54 AM UTC: @kiftio merged this pull request with Graphite.

@kiftio
kiftio changed the base branch from 07-29-include_protocol_in_root_development_commands to graphite-base/529 July 29, 2026 10:37
@kiftio
kiftio changed the base branch from graphite-base/529 to main July 29, 2026 10:37
Assisted-By: devx/4075c309-3611-4ac8-9ea7-26a8974e7963
@kiftio
kiftio force-pushed the 07-29-add_lifecycle_dispatcher_tests branch from 227fe23 to 8185daf Compare July 29, 2026 10:38
@kiftio
kiftio merged commit 8610798 into main Jul 29, 2026
31 of 33 checks passed
@kiftio
kiftio deleted the 07-29-add_lifecycle_dispatcher_tests branch July 29, 2026 10:54
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