Skip to content

Clear CheckoutController state after completion - #13804

Draft
jaynewstrom-stripe wants to merge 1 commit into
jaynewstrom/checkout-controller-refresh-confirmed-statefrom
jaynewstrom/checkout-controller-clear-completed-state
Draft

Clear CheckoutController state after completion#13804
jaynewstrom-stripe wants to merge 1 commit into
jaynewstrom/checkout-controller-refresh-confirmed-statefrom
jaynewstrom/checkout-controller-clear-completed-state

Conversation

@jaynewstrom-stripe

@jaynewstrom-stripe jaynewstrom-stripe commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Clears CheckoutController state after the serialized confirmation refresh and before delivering Result.Completed.
  • Documents that the public session flow returns to null after a completed payment flow.
  • Updates the concurrency test to assert the completed session is cleared.

Stack position: 5 of 5 (top), based on #13803.

Motivation

A successfully completed payment flow should not leave a stale Checkout Session available for further mutation or reuse. Clearing after the best-effort refresh preserves confirmation ordering while ensuring observers and the result callback see the controller in its terminal state.

Testing

  • Added tests
  • Modified tests
  • Manually verified

./gradlew :paymentsheet:testDebugUnitTest --tests com.stripe.android.checkout.CheckoutSheetLauncherTest --tests com.stripe.android.paymentelement.confirmation.intent.CheckoutSessionConfirmationInterceptorTest --tests com.stripe.android.checkout.CheckoutConfirmationResultHandlerTest --tests com.stripe.android.checkout.CheckoutConfirmationStateUpdaterTest --tests com.stripe.android.checkout.CheckoutControllerTest

No tests were ignored.

Screenshots

Not applicable — there are no visual changes.

Changelog

Not included — CheckoutController remains a preview API.

@jaynewstrom-stripe
jaynewstrom-stripe requested review from a team as code owners August 6, 2026 19:19
@jaynewstrom-stripe
jaynewstrom-stripe requested review from samer-stripe and removed request for a team August 6, 2026 19:19
@jaynewstrom-stripe
jaynewstrom-stripe marked this pull request as draft August 6, 2026 19:21
@jaynewstrom-stripe
jaynewstrom-stripe force-pushed the jaynewstrom/checkout-controller-clear-completed-state branch from 69b0cf5 to 856eeb5 Compare August 6, 2026 19:49
@jaynewstrom-stripe
jaynewstrom-stripe force-pushed the jaynewstrom/checkout-controller-clear-completed-state branch from 856eeb5 to 4daf3a9 Compare August 6, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant