App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-07] [$250] No RBR on Subscription row in the LHN in settings if the free trial has expired

Open m-natarajan opened this issue 1 year ago β€’ 16 comments

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: 9.0.62-3 Reproducible in staging?: y Reproducible in production?: y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: 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: @allgandalf Slack conversation (hyperlinked to channel name): Expensify bugs

Action Performed:

  1. Open an account who free trial has expired
  2. Go to settings > Subscription

Expected Result:

RBR should also be on the Subscription row in the LHN

Actual Result:

Observe that there is a RBR on the Page but not on the settings option

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
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Screenshot 2024-11-14 at 3 24 16β€―PM (1)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021858434959504168009
  • Upwork Job ID: 1858434959504168009
  • Last Price Increase: 2024-11-18
  • Automatic offers:
    • daledah | Contributor | 104948042
Issue OwnerCurrent Issue Owner: @zanyrenney

m-natarajan avatar Nov 14 '24 20:11 m-natarajan

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

melvin-bot[bot] avatar Nov 14 '24 20:11 melvin-bot[bot]

Proposal

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

No RBR on Subscription row in the LHN in settings if the free trial has expired

What is the root cause of that problem?

We are checking the condition to show RBR in the sidebar here, it depends on function hasSubscriptionRedDotError here

And with case POLICY_OWNER_WITH_AMOUNT_OWED_OVERDUE we didn't update isError=true

https://github.com/Expensify/App/blob/6ba2c9782d4b2169a3407e6daf4bf3d9f7ef9f4a/src/pages/settings/InitialSettingsPage.tsx#L198

https://github.com/Expensify/App/blob/6ba2c9782d4b2169a3407e6daf4bf3d9f7ef9f4a/src/libs/SubscriptionUtils.ts#L356-L358

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

Simply we only need to add isError=true here

https://github.com/Expensify/App/blob/6ba2c9782d4b2169a3407e6daf4bf3d9f7ef9f4a/src/libs/SubscriptionUtils.ts#L272-L274

Noted: We should check again with another case that we need to RBR

What alternative solutions did you explore? (Optional)

daledah avatar Nov 14 '24 20:11 daledah

Proposal

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

No RBR on Subscription row in the LHN in settings if the free trial has expired

What is the root cause of that problem?

On settings row, we do not check the card error for brickRoadIndicator:

https://github.com/Expensify/App/blob/04d85d858d0a66e16ed304b257282ddda7864c87/src/pages/settings/InitialSettingsPage.tsx#L198 This causes the bug as there will be no RBR for outdated payment methods.

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

Like we do on the cardSection in subscription page , we should add a check for cards errors CardSectionUtils.getBillingStatus(translate, defaultCard?.accountData ?? {})?.isErrow in the settings page as well: https://github.com/Expensify/App/blob/04d85d858d0a66e16ed304b257282ddda7864c87/src/pages/settings/Subscription/CardSection/CardSection.tsx#L68

We will get the defaultCard from fundList, same like we do in cardSection:

https://github.com/Expensify/App/blob/04d85d858d0a66e16ed304b257282ddda7864c87/src/pages/settings/Subscription/CardSection/CardSection.tsx#L54

brickRoadIndicator: !!privateSubscription?.errors || SubscriptionUtils.hasSubscriptionRedDotError() || CardSectionUtils.getBillingStatus(translate, defaultCard?.accountData ?? {})?.isError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,

What alternative solutions did you explore? (Optional)

twilight2294 avatar Nov 14 '24 20:11 twilight2294

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

melvin-bot[bot] avatar Nov 18 '24 08:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 18 '24 09:11 melvin-bot[bot]

Thanks for the proposals, everyone. @daledah 's proposal here is straightforward.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed.

hungvu193 avatar Nov 18 '24 09:11 hungvu193

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

melvin-bot[bot] avatar Nov 18 '24 09:11 melvin-bot[bot]

πŸ“£ @daledah πŸŽ‰ 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 πŸ“–

melvin-bot[bot] avatar Nov 18 '24 09:11 melvin-bot[bot]

@cristipaval @hungvu193 are you sure that is what we want? if you see the image in the OP, the BRB is for Outdated payment info for cards and not for POLICY_OWNER_WITH_AMOUNT_OWED_OVERDUE,

Also if you see the getBillingStatus:

https://github.com/Expensify/App/blob/bd6c90d8493baf70d61937188c94815650f18988/src/pages/settings/Subscription/CardSection/utils.ts#L35-L58

We show errors for all kinds of card errors and not just POLICY_OWNER_WITH_AMOUNT_OWED_OVERDUE. can you please reasses the proposals ?

@daledah can you please hold off the PR for a bit, let try to fix the bug at root .

Also the error is not for subscription status, but rather a card error, where we show a RBR for each case

twilight2294 avatar Nov 18 '24 16:11 twilight2294

Hey @twilight2294, I think your explanation makes sense. However during the proposals review process, here's what I thought:

  • getBillingStatus also used the subscriptionStatus from SubscriptionUtils.getSubscriptionStatus();.
  • hasSubscriptionRedDotError return getSubscriptionStatus()?.isError ?? false; which is the error for the whole Subscription page not only for one specific case and it was also intentional of the Author who implemented failed billing scenarios banner feature.
  • getBillingStatus retrieves billing details, while hasSubscriptionRedDotError indicates the current subscription status, including billing status.

Overall, I'm still aligned with my decision above, we should update the hasSubscriptionRedDotError logic instead of getBillingStatus.

hungvu193 avatar Nov 19 '24 07:11 hungvu193

@hungvu193 PR is ready.

daledah avatar Nov 19 '24 10:11 daledah

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

melvin-bot[bot] avatar Nov 30 '24 13:11 melvin-bot[bot]

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

  • https://github.com/Expensify/App/pull/52742

If no regressions arise, payment will be issued on 2024-12-07. :confetti_ball:

For reference, here are some details about the assignees on this issue:

  • @hungvu193 requires payment through NewDot Manual Requests
  • @daledah requires payment automatic offer (Contributor)
  • @allgandalf requires payment (Needs manual offer from BZ)

melvin-bot[bot] avatar Nov 30 '24 13:11 melvin-bot[bot]

@hungvu193 @zanyrenney @hungvu193 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[bot] avatar Nov 30 '24 13:11 melvin-bot[bot]

BugZero Checklist:

  • [ ] [Contributor] Classify the bug:
Bug classification

Source of bug:

  • [ ] 1a. Result of the original design (eg. a case wasn't considered)
  • [ ] 1b. Mistake during implementation
  • [ ] 1c. Backend bug
  • [ ] 1z. Other:

Where bug was reported:

  • [ ] 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • [ ] 2b. Reported on staging (eg. found during regression or PR testing)
  • [ ] 2d. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [ ] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [ ] 3d. QA
  • [ ] 3z. Other:
  • [ ] [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment:

  • [ ] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion:

  • [ ] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [ ] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree πŸ‘ or πŸ‘Ž

hungvu193 avatar Dec 09 '24 04:12 hungvu193

Source of bug:

  • [ ] 1a. Result of the original design (eg. a case wasn't considered)
  • [x] 1b. Mistake during implementation
  • [ ] 1c. Backend bug
  • [ ] 1z. Other:

Where bug was reported:

  • [x] 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • [ ] 2b. Reported on staging (eg. found during regression or PR testing)
  • [ ] 2d. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [ ] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [x] 3d. QA
  • [ ] 3z. Other:
  • [x] [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/44072/files#r1875328860

  • [x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal

Test:

  1. Open an account with free trial expired
  2. Go to settings > Subscription
  3. Verify that: RBR is displayed on LHN

Do we agree πŸ‘ or πŸ‘Ž

hungvu193 avatar Dec 09 '24 04:12 hungvu193

@hungvu193, @cristipaval, @zanyrenney, @daledah Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 11 '24 09:12 melvin-bot[bot]

payment summary

@hungvu193 requires payment through NewDot Manual Requests - please request $250 on ND @daledah requires payment automatic offer (Contributor) - paid via upwork @allgandalf requires payment (Needs manual offer from BZ)

zanyrenney avatar Dec 11 '24 11:12 zanyrenney

$250 approved for @hungvu193

garrettmknight avatar Dec 12 '24 11:12 garrettmknight

@allgandalf invited you for the bug bounty here- https://www.upwork.com/jobs/~021867267566328938332

zanyrenney avatar Dec 12 '24 17:12 zanyrenney

Paid @allgandalf $50 via upwork too!

zanyrenney avatar Dec 12 '24 18:12 zanyrenney