Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.28k stars 2.71k forks source link

[HOLD for payment 2024-08-01] [$125] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice #45754

Closed mountiny closed 3 weeks ago

mountiny commented 1 month ago

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: Reproducible in staging?: Y Reproducible in production?: Y 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: @mountiny Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1721384323190839

Action Performed:

Break down in numbered steps

  1. Open Console > Networks tab
  2. Open Profile
  3. Open the Wallet page

Expected Result:

Describe what you think should've happened

The OpenPaymentsPage read call is made only once

Actual Result:

Describe what actually happened

The API was called twice

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?

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/~015c4debdbfd2eca47
  • Upwork Job ID: 1814254841623728799
  • Last Price Increase: 2024-07-19
  • Automatic offers:
    • nyomanjyotisa | Contributor | 103183901
Issue OwnerCurrent Issue Owner: @mallenexpensify
melvin-bot[bot] commented 1 month ago

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.

nyomanjyotisa commented 1 month ago

Proposal

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

Opening the Wallet page calls the OpenPaymentsPage twice

What is the root cause of that problem?

The root cause of this problem is the presence of two separate useEffect hooks in WalletPage.tsx that both trigger the PaymentMethods.openWalletPage() function, leading to the API being called twice during the page load process.

https://github.com/Expensify/App/blob/c1881ed587f46a6ab78a2198573c86cd8c466679/src/pages/settings/Wallet/WalletPage/WalletPage.tsx#L276-L278

https://github.com/Expensify/App/blob/c1881ed587f46a6ab78a2198573c86cd8c466679/src/pages/settings/Wallet/WalletPage/WalletPage.tsx#L289-L294

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

We can remove this one an only trigger the openWalletPage here

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

Upwork job price has been updated to $125

mountiny commented 1 month ago

This is a simple change, @nyomanjyotisa proposal is looking good, assigning

melvin-bot[bot] commented 1 month ago

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

mountiny commented 1 month ago

@nyomanjyotisa what is your ETA for the PR?

nyomanjyotisa commented 1 month ago

I will create a PR right now

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

If no regressions arise, payment will be issued on 2024-08-01. :confetti_ball:

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

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

mallenexpensify commented 1 month ago

Contributor: @nyomanjyotisa paid $125 via Upwork Contributor+: @thesahindia owed $125 via NewDot

@thesahindia plz complete the BZ checklist above.

thesahindia commented 1 month ago
  • [ ] [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:

https://github.com/Expensify/App/pull/22412

  • [ ] [@thesahindia] 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/22412/files#r1701365475

  • [ ] [@thesahindia] A discussion in #expensify-bugs 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:

Not needed

  • [ ] [@thesahindia] Determine if we should create a regression test for this bug.

Not needed

melvin-bot[bot] commented 4 weeks ago

@mallenexpensify, @mountiny, @nyomanjyotisa, @thesahindia Huh... This is 4 days overdue. Who can take care of this?

mallenexpensify commented 3 weeks ago

@thesahindia if you propose we don't want a regression test case, can you provide reasoning why you think we don't need one? For this, I'm assuming it's because The OpenPaymentsPage read call is made only once is more of a backend thing that just needed to be updated and checking for that each time isn't necessary.

thesahindia commented 3 weeks ago

@thesahindia if you propose we don't want a regression test case, can you provide reasoning why you think we don't need one? For this, I'm assuming it's because The OpenPaymentsPage read call is made only once is more of a backend thing that just needed to be updated and checking for that each time isn't necessary.

It was a very specific issue. We added the same code twice and because of that we were calling the api twice.

JmillsExpensify commented 2 weeks ago

$125 approved for @thesahindia