App icon indicating copy to clipboard operation
App copied to clipboard

[OldDot & NewDot] Allow disabling auto renew freely if you haven't been billed at least once.

Open trjExpensify opened this issue 1 year ago β€’ 9 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: v9.0.69-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A 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: @trjExpensify Slack conversation: #convert thread

Action Performed:

NewDot

  1. Go to new.expensify.com
  2. Sign-up for a new account
  3. Choose "Manage my team's expenses" and complete the onboarding modal
  4. Go to Settings > Subscription > Subscription details
  5. Disable the auto renew toggle

OldDot

  1. Go to expensify.com
  2. Choose "Control expenses for a larger organization"
  3. Go to Settings > Workspaces > Group > Subscription
  4. Disable the auto renew toggle

Expected Result:

This is an improvement.

If the user hasn't been billed at least once, toggling off auto-renew should be allowed without having to complete the retention survey.

Actual Result:

The retention survey is shown to the user, which is confusing because none of the options make sense to a new user who hasn't been billed yet.

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

FS here (internal)

image

image (23)

View all open jobs on GitHub

trjExpensify avatar Dec 02 '24 13:12 trjExpensify

Current assignee @trjExpensify is eligible for the NewFeature assigner, not assigning anyone new.

melvin-bot[bot] avatar Dec 02 '24 13:12 melvin-bot[bot]

Edited by proposal-police: This proposal was edited at 2024-12-02 14:59:59 UTC.

Proposal

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

Currently, users who attempt to toggle off auto-renew are shown a retention survey, even if they haven't been billed yet. This is confusing for new users who do not identify with the survey options, as they haven't experienced the product enough to provide meaningful feedback.

What is the root cause of that problem?

improvement

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

Introduce a check to determine if the user has billing history (via account?.hasPurchases). If they do, navigate to the retention survey; otherwise, skip it. change this: https://github.com/Expensify/App/blob/2337870c001d8c12f4c0328418cadba0a3e8884f/src/pages/settings/Subscription/SubscriptionSettings/index.tsx#L37

as:

        if(!!account?.hasPurchases){
            Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DISABLE_AUTO_RENEW_SURVEY);
        }else{
            Subscription.updateSubscriptionAutoRenew(false);
        }

Shahidullah-Muffakir avatar Dec 02 '24 14:12 Shahidullah-Muffakir

Proposal

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

Users who have not been billed yet encounter a retention survey when attempting to disable the auto-renew feature. This is unnecessary and confusing because the retention survey options do not make sense for new users who have not incurred any charges.

What is the root cause of that problem?

The current logic for disabling auto-renew does not differentiate between users who have been billed and those who have not. As a result, all users are shown the retention survey regardless of their billing history.

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

src/pages/settings/Subscription/SubscriptionSettings/index.tsx

Determine Billing Status:

Add a check to determine if the user has been billed at least once. The privateSubscription object should include a property (e.g., hasBeenBilled) to track whether the user has been billed. This information can be derived from the server or the subscription details.

Modify handleAutoRenewToggle:

Update the logic to bypass the retention survey if the user hasn't been billed yet:

const handleAutoRenewToggle = () => {
    if (!privateSubscription?.autoRenew) {
        Subscription.updateSubscriptionAutoRenew(true);
        return;
    }
    
    if (!privateSubscription?.hasBeenBilled) {
        // Allow disabling auto-renew freely if user hasn't been billed
        Subscription.updateSubscriptionAutoRenew(false);
        return;
    }

    // Navigate to the retention survey if the user has been billed
    Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DISABLE_AUTO_RENEW_SURVEY);
};

saifelance avatar Dec 03 '24 13:12 saifelance

@mananjadhav @rushatgabhane @mountiny I labelled this as internal, because the retention survey is also shown in this case on OldDot, and I suspect that simply skipping the survey isn't enough to actually disable autoRenew properly. Keen for a second opinion on that.

trjExpensify avatar Dec 05 '24 11:12 trjExpensify

Makes sense to me but I think the the contributors can also check out their solution if it works with purely frontend change. I am not sure if we require the the survey response in BE

mountiny avatar Dec 06 '24 14:12 mountiny

@Shahidullah-Muffakir maybe you can check then. :)

trjExpensify avatar Dec 06 '24 15:12 trjExpensify

@trjExpensify @mountiny I believe FE changes should be enough, as we can use account?.hasPurchases for billing history the same way, we used it here:https://github.com/Expensify/App/issues/51892

https://github.com/user-attachments/assets/4c09e3bf-5a82-4246-9187-7de471cc0d35

Shahidullah-Muffakir avatar Dec 06 '24 16:12 Shahidullah-Muffakir

Can you confirm that properly disables auto-renew? I guess, log-out and back in, or refresh or something?

trjExpensify avatar Dec 06 '24 17:12 trjExpensify

Can you confirm that properly disables auto-renew? I guess, log-out and back in, or refresh or something?

Yes, I tested it, and it's working properly!

https://github.com/user-attachments/assets/ac02b7a9-0f1e-489c-ade7-70ef3147fd5d

Shahidullah-Muffakir avatar Dec 06 '24 18:12 Shahidullah-Muffakir

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

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

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

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

Great stuff! Let's get that moving forward then. @akinwale can you review the proposals, please?

trjExpensify avatar Dec 09 '24 10:12 trjExpensify

After reviewing both proposals, we can move forward with @Shahidullah-Muffakir's proposal since it was posted first and it reuses an approach that already exists in the codebase.

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

akinwale avatar Dec 09 '24 11:12 akinwale

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

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

πŸ“£ @Shahidullah-Muffakir You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing πŸ“–

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

@akinwale , PR https://github.com/Expensify/App/pull/54055 is ready for review, Thank you.

Shahidullah-Muffakir avatar Dec 12 '24 18:12 Shahidullah-Muffakir

This was deployed to production on 2024-12-18, so it will be due for payment on 2024-12-25.

Happy holidays!

akinwale avatar Dec 23 '24 08:12 akinwale

Friendly bump for pending payment.

Shahidullah-Muffakir avatar Dec 26 '24 18:12 Shahidullah-Muffakir

Payment complete to @Shahidullah-Muffakir

@akinwale due $250 via ND manual request for C+ work.

Will leave this open for you to close @trjExpensify

bfitzexpensify avatar Dec 30 '24 11:12 bfitzexpensify

Thanks for handling that, @bfitzexpensify. @techievivek will you take on the OldDot side of this issue?

trjExpensify avatar Jan 03 '25 11:01 trjExpensify

$250 approved for @akinwale

JmillsExpensify avatar Jan 07 '25 13:01 JmillsExpensify

Bump on this, @techievivek.

trjExpensify avatar Jan 16 '25 15:01 trjExpensify

Aaah, sorry, I missed the ping, I can take a look into it tomorrow.

techievivek avatar Jan 16 '25 15:01 techievivek

Thank you!

trjExpensify avatar Jan 16 '25 16:01 trjExpensify

I saw this near the top of the Hot Picks list - @techievivek you got it covered or are you looking to hand off?

amyevans avatar Jan 16 '25 16:01 amyevans

Hi, @amyevans, please feel free to take over, I have few other pressing tasks on my plate. Thanks.

techievivek avatar Jan 16 '25 16:01 techievivek

PRs are into review.

Auth PR: https://github.com/Expensify/Auth/pull/13874 Web PR: https://github.com/Expensify/Web-Expensify/pull/45183

amyevans avatar Jan 17 '25 21:01 amyevans

The OldDot portion is live now too so I believe we're all set to close!

amyevans avatar Jan 23 '25 21:01 amyevans