Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
6 tasks done
IuliiaHerets opened this issue Sep 16, 2024 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 16, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected]
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:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1609.txt

Bug6605199_1726476130689.20240916_163618.mp4

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
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

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

Copy link

melvin-bot bot commented Sep 16, 2024

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.

Copy link
Contributor

👋 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
Copy link
Author

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Sep 16, 2024

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.

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

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]);

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

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

What alternative solutions did you explore? (Optional)

@techievivek
Copy link
Contributor

It might be related to this PR #48566

@techievivek
Copy link
Contributor

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
Copy link
Contributor

@nkdengineer can you work on this quickly?

@huult
Copy link
Contributor

huult commented Sep 16, 2024

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.

const personalDetails = usePersonalDetails();

and error occurs when getting data at this line.
return PersonalDetailsUtils.createDisplayName(personalDetails[filter]?.login ?? '', personalDetails[filter]);

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
Copy link
Contributor

@lakchote Sure.

@ChavdaSachin
Copy link
Contributor

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?

  • cardList passed here is emptyObject after clearing cache and restart

    App/src/libs/SearchUtils.ts

    Lines 700 to 711 in 19d037b

    function getDisplayValue(filterName: string, filter: string, personalDetails: OnyxTypes.PersonalDetailsList, cardList: OnyxTypes.CardList, reports: OnyxCollection<OnyxTypes.Report>) {
    if (filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM || filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.TO) {
    return PersonalDetailsUtils.createDisplayName(personalDetails[filter]?.login ?? '', personalDetails[filter]);
    }
    if (filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID) {
    return cardList[filter].bank;
    }
    if (filterName === CONST.SEARCH.SYNTAX_FILTER_KEYS.IN) {
    return ReportUtils.getReportName(reports?.[`${ONYXKEYS.COLLECTION.REPORT}${filter}`]);
    }
    return filter;
    }
  • and we are not making use of optional chaining for cardList

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

  • Make use of optional chaining while reading data from cardList
        return cardList?.[filter].bank;

return cardList[filter].bank;

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

Here is the crash log. cc @lakchote

Screen.Recording.2024-09-16.at.17.59.52.mov

@lakchote
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

Payment Summary

Upwork Job

BugZero Checklist (@kadiealexander)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Sep 25, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-09-23] [Search v2.3] - App crashes after saving search with user and clear cache and restart [$250] [HOLD for payment 2024-09-23] [Search v2.3] - App crashes after saving search with user and clear cache and restart Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@kadiealexander kadiealexander removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

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

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

Bump for payment @kadiealexander

@melvin-bot melvin-bot bot removed the Overdue label Oct 1, 2024
@kadiealexander
Copy link
Contributor

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

@kadiealexander
Copy link
Contributor

Let me know when you've accepted it please.

@DylanDylann
Copy link
Contributor

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

@nkdengineer
Copy link
Contributor

Let me know when you've accepted it please.

@kadiealexander I just accepted 👍

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2024
@melvin-bot melvin-bot bot removed the Overdue label Oct 6, 2024
@DylanDylann
Copy link
Contributor

@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
Copy link
Contributor

kadiealexander commented Oct 7, 2024

@DylanDylann please accept the offer

@kadiealexander kadiealexander reopened this Oct 7, 2024
@DylanDylann
Copy link
Contributor

@kadiealexander I accepted 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
Status: Done
Development

No branches or pull requests

9 participants