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

[Awaiting Payment 26th August] [$250] [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing #45645

Closed
blimpich opened this issue Jul 17, 2024 · 27 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@blimpich
Copy link
Contributor

blimpich commented Jul 17, 2024

Problem

When changing the billing currency on the subscription page, the panel closes immediately after clicking "save". This is a problem because if the request has an error we should show that error in the panel, but the panel will have already closed.

Screen.Recording.2024-07-29.at.4.54.04.PM.mov

Solution

We should have this panel behave the same way that the add payment card panel behaves. It should wait for the request to finish and show a loading indicator while we wait.

cc: @dominictb

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bcbde08595f89c2b
  • Upwork Job ID: 1818075810728864794
  • Last Price Increase: 2024-07-30
  • Automatic offers:
    • nkdengineer | Contributor | 103346635
Issue OwnerCurrent Issue Owner: @rushatgabhane
@blimpich
Copy link
Contributor Author

Holding and not adding the external label until necessary backend changes are done

Copy link

melvin-bot bot commented Jul 23, 2024

@blimpich Huh... This is 4 days overdue. Who can take care of this?

@blimpich
Copy link
Contributor Author

Almost there, backend changes are still in review.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 23, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

@blimpich Huh... This is 4 days overdue. Who can take care of this?

@blimpich blimpich changed the title [Payment card / Subscription][HOLD #45124] Make change billing card currency form wait until request has finished before closing [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing Jul 29, 2024
@blimpich blimpich added External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. labels Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

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

@melvin-bot melvin-bot bot changed the title [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing [$250] [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing Jul 30, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

Triggered auto assignment to @isabelastisser (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Jul 30, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Jul 30, 2024

Proposal

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

We want to make change billing card currency form wait until request has finished before closing

What is the root cause of that problem?

In

, we go back immediately after calling the API, we don't wait for the API to be successful.

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

  • Remove the goBack here
  • Add an useEffect that will only call goBack if the isLoading of the ONYXKEYS.FORMS.CHANGE_BILLING_CURRENCY_FORM changes from true to false, and there's no errors in the form (so it's not the failure case). This is same approach with adding debit card page
    if (prevFormDataSetupComplete || !formData?.setupComplete) {

What alternative solutions did you explore? (Optional)

Use API.makeRequestWithSideEffects for the PaymentMethods.updateBillingCurrency and make the app wait for it before calling Navigation.goBack

@melvin-bot melvin-bot bot added the Daily KSv2 label Jul 30, 2024
@dominictb
Copy link
Contributor

@blimpich Based on this comment, can I continue to work on this issue?

@blimpich
Copy link
Contributor Author

@dominictb I'm treating this the same as any other external issue. Please feel free to give a proposal and we'll go through the normal proposal proposal review process.

Copy link

melvin-bot bot commented Jul 31, 2024

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

@blimpich
Copy link
Contributor Author

@rushatgabhane we want to avoid using makeRequestWithSideEffects unless absolutely necessary, as per this comment. Can you reconsider the existing proposals given that we want to avoid using makeRequestWithSideEffects?

@rushatgabhane
Copy link
Member

rushatgabhane commented Jul 31, 2024

Okay then we will have to use some variation of useEffect to re-render and go back.

Add an useEffect that will only call goBack if the isLoading of the ONYXKEYS.FORMS.CHANGE_BILLING_CURRENCY_FORM changes from true to false, and there's no errors in the form (so it's not the failure case). This is same approach with adding debit card page

@nkdengineer's proposal looks good

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

📣 @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 📖

@blimpich
Copy link
Contributor Author

Assigning @nkdengineer since they have the C+ chosen solution and posted their proposal first. Sorry @dominictb, but even though you had a solution for the issue on the other issue I'm going to treat this as a normal issue and consider proposals in the order they were posted to this issue and this issue only.

@nkdengineer please feel free to raise a PR.

@nkdengineer
Copy link
Contributor

@blimpich we have open PR here
But there are some errors occurring. As far as I know, we need to add some special steps here.
Please help me.

@blimpich
Copy link
Contributor Author

blimpich commented Aug 5, 2024

@nkdengineer the special steps were just to use my local backend via ngrok. I've DM'ed you those credentials so you should be able to use Stripe's test cards, if I'm online. I generally work 9am-5pm PST hours.

@blimpich
Copy link
Contributor Author

@rushatgabhane from this comment it looks like we're waiting on you to re-review. Are you still able to review this PR?

@rushatgabhane
Copy link
Member

@blimpich thanks for the bump. I'll be reviewing it tonight

@garrettmknight
Copy link
Contributor

@isabelastisser looks like the PR is on prod btw.

@isabelastisser
Copy link
Contributor

Thanks for the heads up, @garrettmknight! So we're waiting for the PR to merge.

@trjExpensify
Copy link
Contributor

PR hit prod on the 19th August. #46635

@trjExpensify trjExpensify added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Aug 26, 2024
@trjExpensify trjExpensify changed the title [$250] [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing [Awaiting Payment 26th August] [$250] [Payment card / Subscription] Make change billing card currency form wait until request has finished before closing Aug 26, 2024
@trjExpensify trjExpensify added Daily KSv2 and removed Weekly KSv2 labels Aug 26, 2024
@melvin-bot melvin-bot bot removed the Overdue label Aug 26, 2024
@isabelastisser
Copy link
Contributor

Payment summary:

@rushatgabhane $250 / C+ review / NewDot payment PENDING
@nkdengineer $250 / Contributor / Paid in Upwork

@JmillsExpensify
Copy link

$250 approved for @rushatgabhane

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
No open projects
Status: Done
Development

No branches or pull requests

8 participants