Skip to content

Fix: Clear Intent Data #1646

Open
noguier wants to merge 11 commits into
mainfrom
clear-intent-data
Open

Fix: Clear Intent Data #1646
noguier wants to merge 11 commits into
mainfrom
clear-intent-data

Conversation

@noguier

@noguier noguier commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • Clear intent data for demo flows to avoid having a stale result.
  • add instructions to clear the intent and pendingRequest to README

AI Usage

Which AI Agent Was Used?

  • Copilot
  • Claude
  • Other (Type Name Here)

How was AI used?
NA

Estimated AI Code Contribution

  • less than 30%
  • 30 - 60%
  • 60 - 100%

Checklist

  • Added a changelog entry
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

List GitHub usernames for everyone who contributed to this pull request.
@noguier

Copilot AI review requested due to automatic review settings July 15, 2026 15:47
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent stale deep-link return data from being re-processed in demo return-to-app flows, and updates developer-facing documentation to instruct clearing Intent.data after handling results. It also updates the documented Google Pay dependency version and adds a build-requirements section to DEPENDENCIES.md.

Changes:

  • Clear Activity.intent.data in Shopper Insights demo fragments after return-to-app handling.
  • Update README.md examples/instructions to clear intent.data to avoid stale results.
  • Add “Build Requirements (Merchant-Facing)” to DEPENDENCIES.md and bump documented play-services-wallet to 19.5.0.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
README.md Updates examples/instructions to clear intent.data after receiving results.
DEPENDENCIES.md Adds build requirements section and updates the documented Google Pay dependency version.
Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragmentV2.kt Clears intent data on resume to avoid stale return-to-app processing in the demo flow.
Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt Clears intent data on resume to avoid stale return-to-app processing in the demo flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread DEPENDENCIES.md Outdated
Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt Outdated
Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragmentV2.kt Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 16:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Anastasiia Noguier <anoguier@paypal.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt Outdated
Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragmentV2.kt Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread DEPENDENCIES.md Outdated
Comment thread DEPENDENCIES.md Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Copilot AI review requested due to automatic review settings July 15, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragment.kt Outdated
Comment thread Demo/src/main/java/com/braintreepayments/demo/ShopperInsightsFragmentV2.kt Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 21:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated
@noguier
noguier marked this pull request as ready for review July 15, 2026 22:32
@noguier
noguier requested a review from a team July 15, 2026 22:32
@noguier
noguier requested a review from a team as a code owner July 15, 2026 22:32
@saralvasquez

Copy link
Copy Markdown
Contributor

Is the dependency work related to clearing intent data?

@noguier

noguier commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Is the dependency work related to clearing intent data?

No, this is just something i wanted to add to this PR, since it is a small change, and we decided to add build dependencies to out DEPENDENCIES.md

@saralvasquez

Copy link
Copy Markdown
Contributor

Ah ok. I feel like the dependency changes should be in their own PR. I know that it's a small change, but having work lumped in that's unrelated to the ticket and PR title it's connected to makes it harder or impossible to track down why certain changes were made

@noguier

noguier commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Ah ok. I feel like the dependency changes should be in their own PR. I know that it's a small change, but having work lumped in that's unrelated to the ticket and PR title it's connected to makes it harder or impossible to track down why certain changes were made

well, we are not changing the dependencies in this PR, more so we are updating the doc so that the dependencies that were already changed are updated in the markdown! But I see your point and can remove it from this PR :)

Copilot AI review requested due to automatic review settings July 16, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread README.md
Comment on lines 282 to 286
After you've received a result, clear out the `intent.data` by setting it to null.

```kotlin
intent.data = null
requireActivity().intent.data = null
```

private fun handlePayPalReturnToApp() {
if (this::paypalStartedPendingRequest.isInitialized) {
val pendingRequest = paypalStartedPendingRequest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this extra property here or we were worried about the value of paypalStartedPendingRequest changing?


private fun handleVenmoReturnToApp() {
if (this::venmoStartedPendingRequest.isInitialized) {
val pendingRequest = venmoStartedPendingRequest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


private fun handlePayPalReturnToApp() {
if (this::paypalStartedPendingRequest.isInitialized) {
val pendingRequest = paypalStartedPendingRequest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great question, I was actually just trying to match the pattern we already have in the PayPalFragment, since I changed the var from lateinit to nullable we do not need the isInitialized check anymore. We only worry about pendingRequest state now.

@saralvasquez saralvasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Just one suggestion and I'm also curious about Matt's question about the extra property

Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@saralvasquez saralvasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants