Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Duplicate paid adoption events are logged each time a payment card is added #57122

Open
4 of 8 tasks
arosiclair opened this issue Feb 19, 2025 · 17 comments
Open
4 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@arosiclair
Copy link
Contributor

arosiclair commented Feb 19, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.60-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): All
Logs: N/A
Expensify/Expensify Issue URL: N/A
Issue reported by: @arosiclair
Slack conversation (hyperlinked to channel name): https://expensify.slack.com/archives/C07HPDRELLD/p1739905840251309

Action Performed:

  1. Sign into NewDot with a new admin account
  2. Go to Avatar > Subscription
  3. Add a payment card
  4. Select Change payment card in the card's 3-dot menu
  5. Enter new details and submit

Expected Result:

[info] [GTM] event published - {"event":"paid_adoption","user_id":###} is NOT logged in the console since it's not the first payment card

Actual Result:

The event is logged

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021892259730792067530
  • Upwork Job ID: 1892259730792067530
  • Last Price Increase: 2025-02-19
  • Automatic offers:
    • nkdengineer | Contributor | 106206679
Issue OwnerCurrent Issue Owner: @rushatgabhane
@arosiclair arosiclair added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 19, 2025
@arosiclair arosiclair self-assigned this Feb 19, 2025
Copy link

melvin-bot bot commented Feb 19, 2025

Triggered auto assignment to @maddylewis (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@arosiclair
Copy link
Contributor Author

The add/change flows are slightly different so we should be able to just fix this on the frontend.

@arosiclair arosiclair added the External Added to denote the issue can be worked on by a contributor label Feb 19, 2025
@melvin-bot melvin-bot bot changed the title Duplicate paid adoption events are logged each time a payment card is added [$250] Duplicate paid adoption events are logged each time a payment card is added Feb 19, 2025
Copy link

melvin-bot bot commented Feb 19, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021892259730792067530

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 19, 2025
Copy link

melvin-bot bot commented Feb 19, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

@nkdengineer
Copy link
Contributor

nkdengineer commented Feb 19, 2025

Proposal

Please re-state the problem that we are trying to solve in this issue.

Duplicate paid adoption events are logged each time a payment card is added

What is the root cause of that problem?

when we Change payment card we will navigate to route SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD and call function addSubscriptionPaymentCard here

{
icon: Expensicons.CreditCard,
text: translate('subscription.cardSection.changeCard'),
onSelected: () => Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD),
},

PaymentMethods.addSubscriptionPaymentCard(accountID ?? 0, cardData);

and in the addSubscriptionPaymentCard function we are logging without distinguishing between creating new or changing here

GoogleTagManager.publishEvent(CONST.ANALYTICS.EVENT.PAID_ADOPTION, accountID);

What changes do you think we should make in order to solve the problem?

We can rely on the Onyx key FUND_LIST to see if we are creating a new card or changing to a different card.

If change to another card, will not log here anymore and will add new log Log.info('[GTM] Not logging paid_adoption because a card was already added');.

GoogleTagManager.publishEvent(CONST.ANALYTICS.EVENT.PAID_ADOPTION, accountID);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 19, 2025

@nkdengineer's proposal LGMT 🎀👀🎀

#57122 (comment)

Copy link

melvin-bot bot commented Feb 19, 2025

Current assignee @arosiclair is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@rushatgabhane
Copy link
Member

@nkdengineer could you please where are we calling the function addSubscriptionPaymentCard on navigation?

@arosiclair
Copy link
Contributor Author

@nkdengineer another requirement: we should log when we are not publishing the event so it's easier to debug later. Eg: [GTM] Not logging paid_adoption because a card was already added

@nkdengineer
Copy link
Contributor

@arosiclair @rushatgabhane updated proposal

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 20, 2025
Copy link

melvin-bot bot commented Feb 20, 2025

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@nkdengineer
Copy link
Contributor

@rushatgabhane @arosiclair We have a draft PR here.
But as mentioned in this issue, we need to use an internal Expensify engineer's ngrok credentials in order to test this. @arosiclair could you help me here or can we skip the testing step?

You will need to use an internal Expensify engineer's ngrok credentials in order to test this. If you'd like to work on this please message @blimpich and I will provide you with instructions on how to use my local backend via ngrok.

@arosiclair
Copy link
Contributor Author

@nkdengineer can you add a test to GoogleTagManagerTest instead? That should be enough.

@nkdengineer
Copy link
Contributor

thanks @arosiclair, I'll open PR today

@melvin-bot melvin-bot bot added Overdue Reviewing Has a PR in review and removed Daily KSv2 Overdue labels Feb 24, 2025
@melvin-bot melvin-bot bot added the Weekly KSv2 label Feb 24, 2025
@nkdengineer
Copy link
Contributor

@rushatgabhane @arosiclair we have a open PR here

@maddylewis
Copy link
Contributor

@rushatgabhane @arosiclair - will you take a look at the PR for this one when you have a chance? tysm!

@arosiclair
Copy link
Contributor Author

It's merged already. We're just waiting on the deploy to prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: No status
Development

No branches or pull requests

4 participants