Skip to content

[HOLD for payment 2024-07-24] [$250] [HIGH] [API] OpenWorkspaceView API call is made on pages that do not need it #42900

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?:
Reproducible in production?:
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:

Action Performed:

Break down in numbered steps

  1. Go to settings
  2. Navigate to workspaces
  3. Select a workspace
  4. Notice that OpenWorkspaceView API command is called

Expected Result:

Describe what you think should've happened

this command is used to load bank account data and it should be called in Workflows page and/ or some other pages where we might need the bank account information for the policy, paid or free (still since migration is not complete)

Actual Result:

Describe what actually happened

This is being called on pages where the bank account details are not needed

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/~01c3a5ef10ba51590e
  • Upwork Job ID: 1796465195576598528
  • Last Price Increase: 2024-05-31
  • Automatic offers:
    • hoangzinh | Reviewer | 102543634
    • abzokhattab | Contributor | 102543638
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 31, 2024
  2. melvin-bot commented on May 31, 2024

    @melvin-bot

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

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 31, 2024
  4. changed the title [-][HIGH] [API] OpenWorkspaceView API call is made on pages that do not need it[/-] [+][$250] [HIGH] [API] OpenWorkspaceView API call is made on pages that do not need it[/+] on May 31, 2024
  5. melvin-bot commented on May 31, 2024

    @melvin-bot
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 31, 2024
  7. melvin-bot commented on May 31, 2024

    @melvin-bot

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

  8. mountiny commented on May 31, 2024

    @mountiny
    ContributorAuthor

    either we need to refactor this code so the API call is not in the WorkspacePageWithSections component as then people will forget to pass the shouldSkipVBBA call - that would be ideal, or we make that param required and pass it everywhere

  9. abzokhattab commented on May 31, 2024

    @abzokhattab
    Contributor

    Proposal

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

    The problem we are trying to solve is that the OpenWorkspaceView API call is being made on pages that do not require it. This results in unnecessary API calls, which can lead to performance issues and inefficient use of resources.

    What is the root cause of that problem?

    The root cause of the problem is that the OpenWorkspaceView API call is embedded within the WorkspacePageWithSections component. This leads to the API call being executed regardless of whether the page actually requires bank account information, as the component does not conditionally skip the API call when it is not needed.

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

    To solve this problem, we propose the following changes:

    • Ensure that the parameter shouldSkipVBBACall is required and passed explicitly wherever the WorkspacePageWithSections component is used.
    • Update all relevant pages and components to correctly utilize the shouldSkipVBBACall parameter, making sure that the OpenWorkspaceView API call is only made on pages where bank account details are actually needed.
    • additionally we need add shouldSkipVBBACall to the WorkspaceProfilePage to prevent the current issue from occurring

    Optionally:

    To preserve the separation of concerns principle, we can create an intermediate component WorkspaceViewLoader which will handle the fetching and loading parts. This component will return a loading component if the data is still loading; otherwise, it will return the children components.

    This component should be called within the WorkspacePageWithSections component.

    Alternatively

    To preserve the separation of concerns principle, we can:

    1. Completely remove the shouldSkipVBBACall flag.
    2. Create a new component, WorkspacePageWithSectionsAndDataLoaded, that handles the data fetching and loading parts. This component will then return WorkspacePageWithSections with the fetched data passed to it.
    3. then in components that require VBB call, the new component should be used, otherwise use the WorkspacePageWithSections component
  10. self-assigned this
    on May 31, 2024
  11. 79 remaining items

  12. mountiny commented on Jul 9, 2024

    @mountiny
    ContributorAuthor

    The Auth PR was merged

  13. greg-schroeder commented on Jul 16, 2024

    @greg-schroeder
    Contributor

    On staging

  14. changed the title [-][$250] [HIGH] [API] OpenWorkspaceView API call is made on pages that do not need it[/-] [+][HOLD for payment 2024-07-24] [$250] [HIGH] [API] OpenWorkspaceView API call is made on pages that do not need it[/+] on Jul 17, 2024
  15. melvin-bot commented on Jul 17, 2024

    @melvin-bot

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

  16. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-07-24. 🎊

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

  17. melvin-bot commented on Jul 17, 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:

    • [@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
    • [@hoangzinh] 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:
    • [@hoangzinh] 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:
    • [@hoangzinh] Determine if we should create a regression test for this bug.
    • [@hoangzinh] 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.
    • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. greg-schroeder commented on Jul 24, 2024

    @greg-schroeder
    Contributor

    This is for the backend PR, no contributors were involved in that one

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.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions