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.52k stars 2.87k forks source link

[$250] [HOLD for payment 2024-09-23] [Search v2.3] - App crashes after saving search with user and clear cache and restart #49249

Closed IuliiaHerets closed 4 weeks ago

IuliiaHerets commented 1 month 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.35-4 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers): applausetester+dfjdfer@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Search > Chats.
  3. Click Filters.
  4. Click From.
  5. Select any user.
  6. Click Save search.
  7. Go to Account settings > Troubleshoot > Clear cache and restart.
  8. Click Reset and refresh.

Expected Result:

App will not crash.

Actual Result:

App crashes.

Workaround:

Unknown

Platforms:

Screenshots/Videos

1609.txt

https://github.com/user-attachments/assets/ddab9d9c-85f0-4e3a-8b99-888458817580

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838824379471456613
  • Upwork Job ID: 1838824379471456613
  • Last Price Increase: 2024-09-25
Issue OwnerCurrent Issue Owner: @kadiealexander
melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

github-actions[bot] commented 1 month 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.
IuliiaHerets commented 1 month ago

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

nkdengineer commented 1 month ago

Proposal

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

App crashes.

What is the root cause of that problem?

personalDetails is undefined after we reset cache and restart.

https://github.com/Expensify/App/blob/b00b9bc8afaa0c359ff7526f4990e81866e8499d/src/libs/SearchUtils.ts#L702

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

Safely get the data here

return PersonalDetailsUtils.createDisplayName(personalDetails?.[filter]?.login ?? '', personalDetails?.[filter]);

https://github.com/Expensify/App/blob/b00b9bc8afaa0c359ff7526f4990e81866e8499d/src/libs/SearchUtils.ts#L702

Or we can set the default value of personalDetails as empty object.

What alternative solutions did you explore? (Optional)

techievivek commented 1 month ago

It might be related to this PR https://github.com/Expensify/App/pull/48566

techievivek commented 1 month ago

I’ll assign this to @lakchote, as it’s related to the search feature. He can decide whether to pass this to external or handle all these minor bugs in a single PR.

lakchote commented 1 month ago

@nkdengineer can you work on this quickly?

huult commented 1 month ago

Proposal

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

App crashes after saving search with user and clear cache and restart

What is the root cause of that problem?

personalDetails returns undefined due to the data being cleared in storage. https://github.com/Expensify/App/blob/19d037b3a900b08de1f8ba2f22624ba445abe3a5/src/components/Search/SearchPageHeader.tsx#L132-L132 and error occurs when getting data at this line. https://github.com/Expensify/App/blob/19d037b3a900b08de1f8ba2f22624ba445abe3a5/src/libs/SearchUtils.ts#L702

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

We set the value EMPTY_OBJECT for personalDetails.

// .src/components/Search/SearchPageHeader.tsx#L132
- const personalDetails = usePersonalDetails();
+ const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;

What alternative solutions did you explore? (Optional)

nkdengineer commented 1 month ago

@lakchote Sure.

ChavdaSachin commented 1 month ago

Proposal

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

What is the root cause of that problem?

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

What alternative solutions did you explore? (Optional)

nkdengineer commented 1 month ago

Here is the crash log. cc @lakchote

https://github.com/user-attachments/assets/b1936fc2-2ea4-458b-9f2f-3e61f99b2efd

lakchote commented 1 month ago

@nkdengineer can you post a video on how your solution fixes it?

nkdengineer commented 1 month ago

@lakchote The result here.

https://github.com/user-attachments/assets/0aa6c961-c091-4055-81ab-d61b9c7878f5

lakchote commented 1 month ago

Assigning you @nkdengineer since you were the first to suggest this solution. Please raise a PR as soon as possible, thanks!

nkdengineer commented 1 month ago

@lakchote The PR is here.

lakchote commented 1 month ago

It isn't a blocker anymore see: https://github.com/Expensify/App/pull/49258#issuecomment-2352770665

melvin-bot[bot] commented 1 month 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.

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.35-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-09-23. :confetti_ball:

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

melvin-bot[bot] commented 1 month ago

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:

techievivek commented 1 month ago

Oops, I was supposed to unassign myself but I unassigned Kadie. Going to add Kadie as BZ member on the GH.

melvin-bot[bot] commented 1 month ago

Payment Summary

[Upwork Job]()

BugZero Checklist (@kadiealexander)

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021838824379471456613

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

@lakchote, @kadiealexander, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

lakchote commented 1 month ago

Bump for payment @kadiealexander

kadiealexander commented 1 month ago

@nkdengineer sent you an Upwork contract, sorry for the delay!

kadiealexander commented 1 month ago

Let me know when you've accepted it please.

DylanDylann commented 1 month ago

@lakchote @kadiealexander I reviewed the PR. Please assign me to this issue and also help to process payment for me. Thanks

nkdengineer commented 1 month ago

Let me know when you've accepted it please.

@kadiealexander I just accepted 👍

DylanDylann commented 4 weeks ago

@kadiealexander could you also kindly take care of the payment for me? since I've already reviewed the PR. Thanks so much! 🙏

cc @lakchote

kadiealexander commented 4 weeks ago

@DylanDylann please accept the offer

DylanDylann commented 4 weeks ago

@kadiealexander I accepted 👍