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.4k stars 2.79k forks source link

Invoices - Invoices page reloads every time leaving bank account setup #49995

Open lanitochka17 opened 1 day ago

lanitochka17 commented 1 day 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: 9.0.42-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

Expected Result:

Invoices page will not reload every time leaving bank account setup. (behavior in Workflows and Wallet page)

Actual Result:

Invoices page reloads every time leaving bank account setup

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/4601d490-b737-40da-9a59-c3f91b51fac1

View all open jobs on GitHub

melvin-bot[bot] commented 1 day ago

Triggered auto assignment to @VictoriaExpensify (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.

lanitochka17 commented 1 day ago

@VictoriaExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 commented 1 day ago

We think that this bug might be related to #vip-bills

Nodebrute commented 1 day ago

Edited by proposal-police: This proposal was edited at 2024-10-01 14:11:13 UTC.

Proposal

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

Invoices page reloads every time leaving bank account setup

What is the root cause of that problem?

We are not passing showLoadingAsFirstRender={false} here that we are passing on other pages https://github.com/Expensify/App/blob/c7ee85b2ea207159ef85932055aced28d5d2e29a/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22-L28

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

We can pass showLoadingAsFirstRender={false} here https://github.com/Expensify/App/blob/c7ee85b2ea207159ef85932055aced28d5d2e29a/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22-L28

What alternative solutions did you explore? (Optional)

We can pass shouldShowLoading={false} https://github.com/Expensify/App/blob/c7ee85b2ea207159ef85932055aced28d5d2e29a/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22-L28

nkdengineer commented 1 day ago

Proposal

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

Invoices - Invoices page reloads every time leaving bank account setup

What is the root cause of that problem?

I notice that the first proposal doesn't define the correct RCA then I post a proposal here.

We pass shouldSkipVBBACall false here

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22-L29

Then we call OpenWorkspaceView API every time the screen is focused which update reimbursementAccount.isLoading to true in optimistic data

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/WorkspacePageWithSections.tsx#L147-L150

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/WorkspacePageWithSections.tsx#L95

Then the loading page appears every time we close the RHP or LHP pages in invoices page because isLoading, shouldShowLoading, isFocused are true

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/WorkspacePageWithSections.tsx#L195-L197

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

We can pass shouldShowLoading prop as false here as we do for other pages like WorkspaceMembersPage, WorkspacePageWithSections

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22

What alternative solutions did you explore? (Optional)

Or we can remove shouldSkipVBBACall={false} so shouldSkipVBBACall can have the default value is true

https://github.com/Expensify/App/blob/d46f21888154dc77a799e06d22e576eaece80368/src/pages/workspace/invoices/WorkspaceInvoicesPage.tsx#L22-L29