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

[HOLD for payment 2024-11-21] Can't clear the free trial expired message from Concierge #50192

Closed
1 of 6 tasks
m-natarajan opened this issue Oct 3, 2024 · 60 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 3, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @zsgreenwald
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1727985469399619

Action Performed:

Precondition: Payment card is added to the account

  1. Login to an account which has free trial left
  2. observe the LHN has "free trial expired" message

Expected Result:

Free trial expired message should not appear if the free trial is left and payment card added to the account

Actual Result:

Unable discard the "free trial expired" message from the LHN

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

CleanShot.2024-10-03.at.12.47.12.mp4
Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021841979108635835758
  • Upwork Job ID: 1841979108635835758
  • Last Price Increase: 2024-10-03
Issue OwnerCurrent Issue Owner: @mallenexpensify
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

Triggered auto assignment to @mallenexpensify (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.

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@abzokhattab
Copy link
Contributor

abzokhattab commented Oct 3, 2024

Edited by proposal-police: This proposal was edited at 2024-10-03 22:19:26 UTC.

Proposal

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

Can't clear the free trial expired message from Concierge

What is the root cause of that problem?

the free trial expired action is shown if !SubscriptionUtils.doesUserHavePaymentCardAdded()

if (SubscriptionUtils.doesUserHavePaymentCardAdded()) {
return null;
}
return (
<BillingBanner
title={translate('subscription.billingBanner.trialEnded.title')}
subtitle={translate('subscription.billingBanner.trialEnded.subtitle')}
icon={Illustrations.Tire}
/>
);

/**
* Whether the user has a payment card added to its account.
*/
function doesUserHavePaymentCardAdded(): boolean {
return userBillingFundID !== undefined;
}

The issue seems to be that the ONYXKEYS.NVP_BILLING_FUND_ID key is not being updated by the backend, causing it to remain null.

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

  1. we can either fix that in the backend
  2. or we can use getCardForSubscriptionBilling instead of doesUserHavePaymentCardAdded, which uses the ONYXKEYS.FUND_LIST key instead
    if (SubscriptionUtils.getCardForSubscriptionBilling()) {
        return null;
    }
  1. this change should be done here as well where we should add the following condition if (ReportActionsUtils.isActionableAddPaymentCard(action) && shouldRenderAddPaymentCard() && !SubscriptionUtils.getCardForSubscriptionBilling())

What alternative solutions did you explore? (Optional)

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 3, 2024
@melvin-bot melvin-bot bot changed the title Can't clear the free trial expired message from Concierge [$250] Can't clear the free trial expired message from Concierge Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 3, 2024
@mallenexpensify
Copy link
Contributor

Removed Help Wanted for a min. @thesahindia , can you review @abzokhattab 's proposal above? Mainly curious if you think this likely needs to be worked on on the backend. Thx

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 3, 2024

Edited by proposal-police: This proposal was edited at 2024-10-03 23:58:27 UTC.

Proposal

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

Unable discard the "free trial expired" message from the LHN

What is the root cause of that problem?

  • The actionable add payment card message are returning from BE, and the "Add payment card" button is always displayed:

if (ReportActionsUtils.isActionableAddPaymentCard(action) && shouldRenderAddPaymentCard()) {
return [
{
text: 'subscription.cardSection.addCardButton',
key: `${action.reportActionID}-actionableAddPaymentCard-submit`,
onPress: () => {
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD);
},
isMediumSized: true,
isPrimary: true,
},
];
}

As we can see, we don't have a logic to hide that message if there is a payment card.

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

  • We should hide or disable the "Add payment card" button if user has already added any payment card. So:

if (ReportActionsUtils.isActionableAddPaymentCard(action) && shouldRenderAddPaymentCard()) {

can be:

        if (ReportActionsUtils.isActionableAddPaymentCard(action) && shouldRenderAddPaymentCard() && !hasPaymentCard) {
  • hasPaymentCard can be obtained from a few utils:
  1. SubscriptionUtils.doesUserHavePaymentCardAdded()

  2. SubscriptionUtils.getCardForSubscriptionBilling()

There two functions should be fix from BE side as well (if needed) to make sure it works properly. Now, as I can see, !!SubscriptionUtils.doesUserHavePaymentCardAdded() is always false.

image

What alternative solutions did you explore? (Optional)

  • If ReportActionsUtils.isActionableAddPaymentCard(action) && hasPaymentCard we can also return false in shouldReportActionBeVisible util function.

  • hasPaymentCard come from the main solution.

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 4, 2024

@mallenexpensify I think before user adds a payment card, the "Add payment card" button is displayed:

image

But after they add any payment card, we just need to hide that button instead of hiding all the message:

image

What do you think?

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 4, 2024

Proposal updated

@abzokhattab
Copy link
Contributor

Proposal Updated

@thesahindia
Copy link
Member

Removed Help Wanted for a min. @thesahindia , can you review @abzokhattab 's proposal above? Mainly curious if you think this likely needs to be worked on on the backend. Thx

We can fix it solely on the front end, but backend changes would be ideal.

I think we should get an engineer here.

🎀 👀 🎀 C+ reviewed ( using it for engineer assignment )

Copy link

melvin-bot bot commented Oct 5, 2024

Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@thesahindia
Copy link
Member

Quoting from #50192 (comment)

/**
* Whether the user has a payment card added to its account.
*/
function doesUserHavePaymentCardAdded(): boolean {
return userBillingFundID !== undefined;
}

The issue seems to be that the ONYXKEYS.NVP_BILLING_FUND_ID key is not being updated by the backend, causing it to remain null.

cc: @youssef-lr

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 5, 2024

@thesahindia The doesUserHavePaymentCardAdded is not related to checking whether we should display the free trial expired message. The issue is that, BE always returns the free trial expired message.

@mkzie2
Copy link
Contributor

mkzie2 commented Oct 6, 2024

@youssef-lr Also, please help check my comment when you have a chance. TY

Copy link

melvin-bot bot commented Oct 8, 2024

@youssef-lr, @mallenexpensify, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Oct 8, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

@youssef-lr, @mallenexpensify, @thesahindia Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Oct 14, 2024

@youssef-lr, @mallenexpensify, @thesahindia 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@mallenexpensify
Copy link
Contributor

@youssef-lr 👀 above plz.
We need to know if you recommend fixing this on the back or frontend.

@thesahindia
Copy link
Member

Just did it.

@youssef-lr
Copy link
Contributor

I just ran the job manually, you should receive the message now.

@thesahindia
Copy link
Member

Thanks! Received it now.

@thesahindia
Copy link
Member

@youssef-lr, Do we have any dummy cards available for testing? Couldn't find something on Slack.

@mallenexpensify
Copy link
Contributor

@thesahindia the deets in the C+ doc for cards won't help ya, right? If you find a workaroud for your usecase and others C+ can use, can you add them to the C+ doc? thx

I'm back from OOO on Nov 14th, not assigning another BZ because payment won't be due til I'm back. If one is needed please add or post in #contributor-plus to ask for one to be added, thx.

@youssef-lr
Copy link
Contributor

@thesahindia I'm writing from mobile, please google Stripe test cards.

@thesahindia
Copy link
Member

@youssef-lr, seems like I can't test this flow. I need to connect to the local backend.

Screenshot 2024-11-07 at 8 47 34 PM

@thesahindia
Copy link
Member

Unassigning myself as I didn’t review the PR and am not eligible for any compensation.

@thesahindia thesahindia removed their assignment Nov 11, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 14, 2024
@melvin-bot melvin-bot bot changed the title Can't clear the free trial expired message from Concierge [HOLD for payment 2024-11-21] Can't clear the free trial expired message from Concierge Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.61-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-21. 🎊

Copy link

melvin-bot bot commented Nov 14, 2024

@youssef-lr @mallenexpensify @youssef-lr The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 20, 2024
@mallenexpensify
Copy link
Contributor

No compensation due here

Copy link

melvin-bot bot commented Nov 21, 2024

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

@youssef-lr, @mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Nov 27, 2024

PR hit production 13 days ago, no issues since, going to close

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 27, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

@youssef-lr, @mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@github-project-automation github-project-automation bot moved this from Product (CRITICAL) to Done in [#whatsnext] #retain Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff
Projects
Status: DONE
Development

No branches or pull requests

8 participants