Repository navigation
fix: deliver Compose PayPal and Pay Later results after Activity recreation - #1755
Merged
Merged
Conversation
…ivity is recreated Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jaxdesmarais
reviewed
Nov 9, 2026
Co-authored-by: Jax DesMarais-Leder <jdesmarais@paypal.com> Signed-off-by: agedd <ageddam@paypal.com>
saralvasquez
reviewed
Nov 9, 2026
saralvasquez
left a comment
Contributor
There was a problem hiding this comment.
I think this looks good! Just a small nit since there's a dependency update
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jaxdesmarais
approved these changes
Nov 9, 2026
jaxdesmarais
left a comment
Contributor
There was a problem hiding this comment.
🚀 thanks for the detailed description and tests
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.
Summary of changes
PayPalLauncher(ActivityResultRegistry, String resultKey), following theresultKeyconvention from Fix: allow a custom ActivityResult registration key #1707. It passes the key to the newBrowserSwitchClient(registry, key)constructor (browser-switch-android#140).rememberSaveableand restore the stored pending request before completing the flow.Why
If the Activity is destroyed while PayPal is open (e.g. "Don't keep activities"), the new launcher registered under a random key and never received the Auth Tab result, so the flow was reported as a cancel. A key that survives recreation lets the result reach the new launcher, and restoring the pending request lets it complete as a success.
Depends on
browser-switch-android 3.7.0
Testing
restoreStoredRequest(nothing stored, restore succeeds, restore fails).AI Usage
Which AI Agent Was Used?
How was AI used?
debugging and refactor
Estimated AI Code Contribution
Checklist
[ ] Added a changelog entryAuthors