Skip to content

Conversation

@dbrant
Copy link
Member

@dbrant dbrant commented Sep 27, 2024

In one of the most unfortunate cases of name shadowing, there were two variables called intent, and we were using the wrong one to get the campaign ID, resulting in a fallback to the default id.

https://phabricator.wikimedia.org/T375124

@dbrant dbrant added Minor Minor stuff High Priority Priority code review needed labels Sep 27, 2024
@dbrant dbrant requested a review from cooltey as a code owner September 27, 2024 20:24
when (resultCode) {
Activity.RESULT_OK -> {
data?.let { intent ->
PaymentData.getFromIntent(intent)?.let { paymentData ->
Copy link
Member Author

Choose a reason for hiding this comment

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

This name of intent is shadowing the Activity's intent getter (shorthand for the function getIntent()), so when we get the campaign ID a few lines later, by calling intent.getStringExtra..., we're referencing the wrong intent!

@cooltey cooltey merged commit be48c04 into main Sep 27, 2024
1 check passed
@cooltey cooltey deleted the intentCampaignId branch September 27, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority Priority code review needed Minor Minor stuff

Development

Successfully merging this pull request may close these issues.

2 participants