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

Open
6 tasks done
IuliiaHerets opened this issue Sep 16, 2024 · 26 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 Overdue

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 16, 2024

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:

  • 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: @abdulrahuman5196
@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?

@lakchote lakchote changed the title [CP Staging] Saved search - App crashes after saving search with user and clear cache and restart Saved search - App crashes after saving search with user and clear cache and restart Sep 16, 2024
@lakchote lakchote removed the DeployBlockerCash This issue or pull request should block deployment label Sep 16, 2024
@lakchote
Copy link
Contributor

It isn't a blocker anymore see:
#49258 (comment)

Copy link

melvin-bot bot commented Sep 16, 2024

⚠️ 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 melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 16, 2024
@melvin-bot melvin-bot bot changed the title Saved search - App crashes after saving search with user and clear cache and restart [HOLD for payment 2024-09-23] Saved search - App crashes after saving search with user and clear cache and restart Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.35-7 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 2024-09-23. 🎊

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

  • @nkdengineer requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Sep 16, 2024

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:

  • [@lakchote / @techievivek] The PR that introduced the bug has been identified. Link to the PR:
  • [@lakchote / @techievivek] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@lakchote / @techievivek] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@nkdengineer] Determine if we should create a regression test for this bug.
  • [@nkdengineer] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@techievivek
Copy link
Contributor

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

@luacmartins luacmartins changed the title [HOLD for payment 2024-09-23] Saved search - App crashes after saving search with user and clear cache and restart [HOLD for payment 2024-09-23] [Search v2.3] - App crashes after saving search with user and clear cache and restart Sep 19, 2024
@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...

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 Overdue
Projects
Status: Done
Development

No branches or pull requests

8 participants