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

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

Closed
6 tasks done
lanitochka17 opened this issue Oct 17, 2023 · 29 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 17, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@Pujan92
Copy link
Contributor

Pujan92 commented Oct 17, 2023

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

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Oct 18, 2023
@melvin-bot melvin-bot bot 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 Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0195a510ee20eb2208

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Oct 19, 2023

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

@adelekennedy
Copy link

two proposals above for you @situchan

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 20, 2023
@adelekennedy
Copy link

still pending a review

@melvin-bot melvin-bot bot removed the Overdue label Oct 24, 2023
@situchan
Copy link
Contributor

I don't think backend should send pusher event with wallet info whenever wallet/bank account/card added/removed.
Assigned engineer will confirm. 🎀 👀 🎀

If no change needed in backend, @Pujan92's proposal looks good. This also sync across devices.

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

Triggered auto assignment to @jasperhuangg, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@adelekennedy
Copy link

@jasperhuangg please check @Pujan92 proposal

@melvin-bot melvin-bot bot removed the Overdue label Oct 26, 2023
@tienifr
Copy link
Contributor

tienifr commented Oct 27, 2023

I don't think backend should send pusher event with wallet info whenever wallet/bank account/card added/removed.

@situchan just curious why you think it should not? We use Pusher all around the app.

@situchan
Copy link
Contributor

bank account setup is offline blocked. So it doesn't make sense to have optimistic data

@tienifr
Copy link
Contributor

tienifr commented Oct 30, 2023

bank account setup is offline blocked. So it doesn't make sense to have optimistic data

@situchan back account deletion is not offline-blocked though, so for deletion do you agree we can add optimistic data?

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@situchan
Copy link
Contributor

situchan commented Oct 30, 2023

@jasperhuangg will decide if this should be fixed purely on backend (by sending wallet pusher data) or this proposal is fine to go.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@jasperhuangg
Copy link
Contributor

I think updating the useEffect here makes sense, let's move forward with that!

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 31, 2023

@Pujan92 @jasperhuangg @adelekennedy @situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@jasperhuangg
Copy link
Contributor

@Pujan92 friendly bump!

@Pujan92
Copy link
Contributor

Pujan92 commented Nov 2, 2023

@situchan @jasperhuangg PR is ready for review!

Copy link

melvin-bot bot commented Nov 9, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Nov 27, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

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!

@situchan
Copy link
Contributor

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

@jasperhuangg
Copy link
Contributor

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

@jasperhuangg jasperhuangg added Weekly KSv2 and removed Monthly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Dec 25, 2023
Copy link

melvin-bot bot commented Dec 25, 2023

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!

@jasperhuangg
Copy link
Contributor

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

@jasperhuangg jasperhuangg added Daily KSv2 and removed Monthly KSv2 labels Jan 3, 2024
@jasperhuangg
Copy link
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
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants