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.34k stars 2.77k forks source link

Search - Expense report has transaction thread & expense previews when submitted from Search #49533

Open IuliiaHerets opened 2 hours ago

IuliiaHerets commented 2 hours 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.39-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Submit an expense to user that has no unsettled expense.
  3. Go to Search > Expenses.
  4. Click on the expense submitted in Step 2.
  5. From the report RHP, click + > Submit expense.
  6. Submit another expense.

Expected Result:

After submitting another expense from Search, app will open expense report with two expense previews.

Actual Result:

After submitting another expense from Search, app shows expense report that has transaction thread and also two expense previews.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/be3fd51f-124b-41da-9e8b-aece64e86b7c

View all open jobs on GitHub

melvin-bot[bot] commented 2 hours ago

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

IuliiaHerets commented 2 hours ago

We think that this bug might be related to #wave-control

IuliiaHerets commented 2 hours ago

@sonialiap 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

FitseTLT commented 1 hour ago

Proposal

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

Search - Expense report has transaction thread & expense previews when submitted from Search

What is the root cause of that problem?

We haven't included prop.transactionThreadReportID in our memoization here https://github.com/Expensify/App/blob/25450d96aca5d30b0fef7bdbfc9379fa71e7cd74/src/pages/home/report/ReportActionsView.tsx#L506 So the rerender doesn't happen even if the transactionThreadReportID is updated

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

We should add


    if (oldProps.transactionThreadReportID !== newProps.transactionThreadReportID) {
        return false;
    }

What alternative solutions did you explore? (Optional)