Skip to content

[$500] Wallet - Wallet page does not update instantly when bank account is added or deleted #29767

Closed

Description

@lanitochka17

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: 1.3.85-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: Applause - Internal Team
Slack conversation:

Issue found when executing PR #28316

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Settings > Wallet > Add payment method > Bank account
  3. Proceed with adding a bank account
  4. After adding a bank account, in the Wallet page, return to Settings and go back to Wallet
  5. Note that now Expensify Wallet shows up
  6. Delete the added bank account
  7. Return to Settings and go back to Wallet
  8. Now it only shows the intro page

Expected Result:

The Wallet page should update instantly when bank account is added or deleted

Actual Result:

When the bank account is added, Expensify Wallet does not show up until the Wallet page is revisited.
The same also happens when the bank account is deleted - Wallet introduction page only shows up after revisting the Wallet page

Workaround:

Unknown

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

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6240239_1697536241317.20231017_132411.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0195a510ee20eb2208
  • Upwork Job ID: 1714697645631545344
  • Last Price Increase: 2023-10-18
  • Automatic offers:
    • situchan | Reviewer | 27446140
    • Pujan92 | Contributor | 27446142

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 17, 2023
  2. melvin-bot commented on Oct 17, 2023

    @melvin-bot

    Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Oct 17, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. Pujan92 commented on Oct 17, 2023

    @Pujan92
    Contributor

    Proposal

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

    Wallet page doesn't update the wallet section on add/deletion of an account

    What is the root cause of that problem?

    Showing of that section depends on the userWallet data which we received from the backend with the OpenPaymentsPage api. This api is currently only called on the mount of the component but seems to be missed In the migration PR to consider calling again for bankAccountList/cardList.

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

    We should add dependencies bankAccountList & cardList in the useEffect for making a call to openWalletPage.

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

    We can combine two(1, 2) blocks to one like below.

        useEffect(() => {
            if (network.isOffline) {
                return;
            }
            PaymentMethods.openWalletPage();
        }, [network.isOffline, bankAccountList, cardList]);
    Result
    Screen.Recording.2023-10-17.at.22.21.25.mp4
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 18, 2023
  6. changed the title [-]Wallet - Wallet page does not update instantly when bank account is added or deleted[/-] [+][$500] Wallet - Wallet page does not update instantly when bank account is added or deleted[/+] on Oct 18, 2023
  7. melvin-bot commented on Oct 18, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 18, 2023
  9. melvin-bot commented on Oct 18, 2023

    @melvin-bot

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

  10. tienifr commented on Oct 19, 2023

    @tienifr
    Contributor

    Proposal

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

    When the bank account is added, Expensify Wallet does not show up until the Wallet page is revisited.
    The same also happens when the bank account is deleted - Wallet introduction page only shows up after revisting the Wallet page

    What is the root cause of that problem?

    In here, we use the content of the userWallet to show the wallet page empty or has-data state.
    However, when we add/delete the account/card, we don't have Pusher events on the wallet data, and we also don't have optimistic data. So only after going back to the wallet page, this will be called again and then the wallet is loaded.

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

    1. Add optimistic data (and failure restored data) to create wallet if this is the first bank account/card that's added
    2. Add optimistic data (and failure restored data) to delete the wallet if we only have 1 last bank account/card and we're deleting it (perhaps, and the wallet balance is 0)
    3. Add Pusher to send back updated wallet information after 1 and 2 above (in case the actual wallet has some differences with the optimistic wallet), or add the wallet details to the API response when we delete/create bank account/card

    What alternative solutions did you explore? (Optional)

    In 3, if we don't want to change the back-end, we can proactively trigger PaymentMethods.openWalletPage again after deleting/creating the bank account/card, by triggering it after the action is done, or add bankAccountList, cardList to useEffect dependency list that triggers the PaymentMethods.openWalletPage

  11. adelekennedy commented on Oct 20, 2023

    @adelekennedy
    Contributor

    two proposals above for you @situchan

  12. 29 remaining items

  13. melvin-bot commented on Nov 27, 2023

    @melvin-bot

    This issue has not been updated in over 15 days. @Pujan92, @jasperhuangg, @adelekennedy, @situchan eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  14. situchan commented on Nov 27, 2023

    @situchan
    Contributor

    @jasperhuangg This requires backend fix as per #31149 (comment)
    cc: @neil-marcellini

  15. jasperhuangg commented on Nov 30, 2023

    @jasperhuangg
    Contributor

    Got it, thanks. I'll look into it when I get the chance!

  16. melvin-bot commented on Dec 25, 2023

    @melvin-bot

    This issue has not been updated in over 15 days. @Pujan92, @jasperhuangg, @adelekennedy, @situchan eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  17. jasperhuangg commented on Jan 2, 2024

    @jasperhuangg
    Contributor

    I still haven't had a chance to look into this, but I can probably take another look at this this week.

  18. jasperhuangg commented on Jan 3, 2024

    @jasperhuangg
    Contributor

    I can't seem to reproduce this bug anymore. Even though we initially weren't sending out a Pusher update for the wallet in Onyx, we send one out when the user finishes the Terms KYC step. I don't think this bug should be happening anymore.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions