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.57k stars 2.91k forks source link

Search - Website crashes after exploring expenses in search for some time #52864

Open IuliiaHerets opened 1 day ago

IuliiaHerets 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.65-0 Reproducible in staging?: Y Reproducible in production?: N Issue reported by: Applause Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Log in with an account with several expenses on it.
  3. Tap on search on the bottom of the page.
  4. Open any expense.
  5. Tap on the arrow on the top left corner.
  6. Open a different expense.
  7. Tap on the arrow on the top left corner.
  8. Repeat steps 4 - 5 a few more times.
  9. Verify that the user can continue exploring all the expenses without the website crashing.

Expected Result:

The user should be able to explore expenses in search without the website crashing.

Actual Result:

The website crashes after opening and closing expenses for some time in search section. Error Message - "Uh oh, something went wrong."

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/044d8248-6eda-4453-8974-b993896758b3

2111_1.txt

View all open jobs on GitHub

melvin-bot[bot] commented 1 day ago

Triggered auto assignment to @MonilBhavsar (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] commented 1 day ago

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

melvin-bot[bot] commented 1 day ago

💬 A slack conversation has been started in #expensify-open-source

github-actions[bot] commented 1 day ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
mkzie2 commented 1 day ago

Proposal

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

The website crashes after opening and closing expenses for some time in search section. Error Message - "Uh oh, something went wrong."

What is the root cause of that problem?

We pass the reportID as report?.reportID, which can be empty string here

https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/pages/home/ReportScreen.tsx#L172

https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/pages/home/ReportScreen.tsx#L224

Then the app crashes when we use useOnyx here, the key changes from report_id to report_ https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/hooks/usePaginatedReportActions.ts#L15

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

Fallback reportID to -1 here

https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/pages/home/ReportScreen.tsx#L172

Or we can use reportIDFromRoute instead https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/pages/home/ReportScreen.tsx#L224

Or we can add fallback -1 here

 const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID || '-1'}`); 

https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/hooks/usePaginatedReportActions.ts#L15

What alternative solutions did you explore? (Optional)

mkzie2 commented 1 day ago

@MonilBhavsar I can raise a quick fix if needed.

melvin-bot[bot] commented 1 day ago

⚠️ 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.

NJ-2020 commented 1 day ago

Offending PR: https://github.com/Expensify/App/pull/50692

Right here we pass reportID which can be empty string

https://github.com/Expensify/App/blob/376f9f08755b0555cf3666c5a880542af57c7da1/src/hooks/usePaginatedReportActions.ts#L14-L15

We can pass like the old one using reportIDWithDefault

rayane-djouah commented 1 day ago

@Krishna2323 Can you please take a look? Thanks

Krishna2323 commented 1 day ago

Will take a look in a hour.

Krishna2323 commented 23 hours ago

@rayane-djouah, PR ready for review. Recordings will be added in few minutes.

melvin-bot[bot] commented 23 hours ago

⚠️ 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.