Skip to content

[Due for payment 2025-05-30] [CRITICAL] Investigate performance issues when deleting expenses from Reports page #59825

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 on HybridApp, is this reproducible on New Expensify Standalone?:
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: @JmillsExpensify
Slack conversation (hyperlinked to channel name): https://expensify.slack.com/archives/C05LX9D6E07/p1743598259881369

Action Performed:

Break down in numbered steps

  1. Using very heavy account similar to Jason's
  2. Go to the Reports page
  3. Delete some expense

Expected Result:

Describe what you think should've happened

The app should not show signs of slowing down

Actual Result:

Describe what actually happened

The app grinds to halt

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Activity

  1. added
    AutoAssignerNewDotQuality
    Bug
    Daily
    on Apr 8, 2025
  2. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    Current assignee @mountiny is eligible for the AutoAssignerNewDotQuality assigner, not assigning anyone new.

  3. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    Triggered auto assignment to @Christinadobrzyn (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. Christinadobrzyn commented on Apr 9, 2025

    @Christinadobrzyn
    Contributor

    @TMisiukiewicz I see you are starred on this GH - are you investigating this? I'm adding an Internal label - I assume this needs to be internal but let me know if I can open this up to External

  5. added
    Internal
    on Apr 9, 2025
  6. mountiny commented on Apr 9, 2025

    @mountiny
    ContributorAuthor

    Yeah he is on it

  7. TMisiukiewicz commented on Apr 11, 2025

    @TMisiukiewicz
    Contributor

    While using heavy account I noticed we already have a lot of heavy operations going on when opening a report so the CPU might be hit even before going to report details and pressing Delete. It's because SearchAutocompleteList is rendered all the time (just hidden behind display: none) and it recomputes entire options list in the context on each report collection item update even if it's hidden and not related to action user is doing. When we open an expense from a list, it updates a couple of reports and that triggers the computations. While it works fine on smaller accounts, it gets pretty complex for bigger ones. Actually once Search is visited, the options are regenerated from scratch on each merge to reports collection so CPU gets hit pretty often.

    I tried building a PoC with exposing sourceValue to useOnyx with collection items and it seems when used in the OptionListContextProvider, it reduces this overhead to the minimum. I'll do some cleanup on Monday and open PRs in Onyx and E/App repos so you can verify it.

    I haven't tested it yet but I'm wondering if this solution going to work properly with deleted items as well 🤔 Are deleted reports entirely removed from Onyx or they have any specific status set that indicates those expenses are deleted? I'm wondering if I am able to catch those by sourceValue or not, because if they are not changed through mergeCollection while being deleted, I have to think additional approach to remove the options for such reports without recomputing everything

  8. TMisiukiewicz commented on Apr 14, 2025

    @TMisiukiewicz
    Contributor

    Created draft PR for onyx with exposing sourceValue for useOnyx hook: Expensify/react-native-onyx#627

    I'm working on proper implementing it to OptionListContextProvider, I think the only thing that left is that the same report now appears for me twice in the options list. Once it's fixed, it'll reduce some heavy computations on large accounts, from my initial measurements on our heavy account on web, depending on an action user is performing, it's 500-1000ms less calculations whenever doing something on Search screen, e.g. opening an expense, updating its description/merchant etc. It'll also reduce computations on any action that is doing changes on reports collection, like sending/receiving a message.

    Yet I haven't tested it with deleting an expenses, but I think it should be doable as well.

  9. mallenexpensify commented on Apr 14, 2025

    @mallenexpensify
    Contributor

    Unsure of status to put on this, seems not not-important.
    Deleting expenses from a reports page seems like a common-enough action that users would take, which makes me lean towards HIGH.

    • CRITICAL - UX Reliability, API Reliability and Performance bugs that are noticeable for a majority of users
    • HIGH -  UX Reliability, API Reliability and Performance issues that are part of main flows and affect a subset of users
    • MEDIUM - Debugging Tools to help make fixing existing bugs easier and getting fixes to customers faster and Architectural Improvements to the underlying framework and design of the app to improve performance, scalability, and maintainability
    • LOW - Not very noticeable UX Reliability, API Reliability or Performance issues that only affect a single user or subset of users
  10. 53 remaining items

  11. melvin-bot commented on May 23, 2025

    @melvin-bot

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

  12. melvin-bot commented on May 23, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.50-0 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 2025-05-30. 🎊

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

  13. melvin-bot commented on May 23, 2025

    @melvin-bot

    @allroundexperts @Christinadobrzyn @allroundexperts The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. mountiny commented on May 27, 2025

    @mountiny
    ContributorAuthor

    Last PR was merged, but lets await regression period

  15. Christinadobrzyn commented on May 29, 2025

    @Christinadobrzyn
    Contributor

    @allroundexperts do we need a regression test for this?

    Payment summary here - #59825 (comment)

    moving to daily since payment is tomorrow.

  16. added
    Daily
    and removed
    Weekly
    on May 29, 2025
  17. allroundexperts commented on Jun 1, 2025

    @allroundexperts
    Contributor

    I don't think a checklist is needed here @Christinadobrzyn.

  18. melvin-bot commented on Jun 2, 2025

    @melvin-bot

    @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick!

  19. Christinadobrzyn commented on Jun 2, 2025

    @Christinadobrzyn
    Contributor

    Awesome, thanks @allroundexperts! No regression test created.

    Payment summary here - #59825 (comment)

    @allroundexperts please make sure to reach out for payment via ND. TY!

  20. JmillsExpensify commented on Jun 13, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @allroundexperts

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

Metadata

Metadata

Labels

AutoAssignerNewDotQualityAwaiting PaymentBugDailyInternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions