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-08-01] [$125] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice #45754

Closed
2 of 6 tasks
mountiny opened this issue Jul 19, 2024 · 18 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@mountiny
Copy link
Contributor

mountiny commented Jul 19, 2024

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?

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

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
@mountiny mountiny added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 19, 2024
@mountiny mountiny self-assigned this Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 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.

@nyomanjyotisa
Copy link
Contributor

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.

useEffect(() => {
PaymentMethods.openWalletPage();
}, []);

useEffect(() => {
if (network.isOffline) {
return;
}
PaymentMethods.openWalletPage();
}, [network.isOffline]);

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)

@mountiny mountiny changed the title [HIGH] [API Requests] Opening the Wallet page calls the OpenPaymentsPage twice [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice Jul 19, 2024
@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jul 19, 2024
@melvin-bot melvin-bot bot changed the title [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice [$250] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

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

melvin-bot bot commented Jul 19, 2024

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

@mountiny mountiny changed the title [$250] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice [$125] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

Upwork job price has been updated to $125

@mountiny
Copy link
Contributor Author

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

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

melvin-bot bot commented Jul 19, 2024

📣 @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
Copy link
Contributor Author

@nyomanjyotisa what is your ETA for the PR?

@nyomanjyotisa
Copy link
Contributor

I will create a PR right now

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jul 19, 2024
@melvin-bot melvin-bot bot changed the title [$125] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice [HOLD for payment 2024-08-01] [$125] [HIGH] [API Reliability] Opening the Wallet page calls the OpenPaymentsPage twice Jul 25, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

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

Copy link

melvin-bot bot commented Jul 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.11-5 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-08-01. 🎊

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

Copy link

melvin-bot bot commented Jul 25, 2024

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@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:
  • [@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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

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

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

@thesahindia plz complete the BZ checklist above.

@thesahindia
Copy link
Member

thesahindia commented Aug 2, 2024

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

#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 melvin-bot bot added the Overdue label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

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

@mallenexpensify
Copy link
Contributor

@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
Copy link
Member

@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
Copy link

$125 approved for @thesahindia

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 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

5 participants