Skip to content

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

Closed

Description

@mountiny

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 19, 2024
  2. self-assigned this
    on Jul 19, 2024
  3. melvin-bot commented on Jul 19, 2024

    @melvin-bot

    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.

  4. nyomanjyotisa commented on Jul 19, 2024

    @nyomanjyotisa
    Member

    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)

  5. 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 [/+] on Jul 19, 2024
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 19, 2024
  7. 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 [/+] on Jul 19, 2024
  8. melvin-bot commented on Jul 19, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 19, 2024
  10. melvin-bot commented on Jul 19, 2024

    @melvin-bot

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

  11. 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 [/+] on Jul 19, 2024
  12. 16 remaining items

  13. melvin-bot commented on Jul 25, 2024

    @melvin-bot

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

  14. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    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:

  15. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    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:
  16. mallenexpensify commented on Aug 1, 2024

    @mallenexpensify
    Contributor

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

    @thesahindia plz complete the BZ checklist above.

  17. thesahindia commented on Aug 2, 2024

    @thesahindia
    Member
    • [@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

  18. melvin-bot commented on Aug 6, 2024

    @melvin-bot

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

  19. mallenexpensify commented on Aug 7, 2024

    @mallenexpensify
    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.

  20. thesahindia commented on Aug 8, 2024

    @thesahindia
    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.

  21. JmillsExpensify commented on Aug 20, 2024

    @JmillsExpensify
    Contributor

    $125 approved for @thesahindia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions