[HOLD for payment 2021-11-04] Chat - No results found message displayed even when results are found
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Go to https://staging.new.expensify.com
- Log in with any account.
- Tap + green fab and select "New chat" option
- On the search box, search any user you have access to
Expected Result:
If a user is found the message ''No result found" hould not be displayed
Actual Result:
No results found message displayed even when results are found for searched user
Workaround:
Unknown
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.91-0 Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/131736762-bb64f633-48fd-40c8-a228-2b6f46903392.mp4

Expensify/Expensify Issue URL:
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Triggered auto assignment to @jasperhuangg (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
@jasperhuangg is going to be schoolin' pretty soon here, so I'm going to grab this deploy blocker from him.
I'm unable to reproduce on staging.
@kavimuru Can you please refresh and/or retest, because the reproduction steps are not working for me.
@roryabraham I can reproduce this on master. Seems a kind of regression.

Hmmm @parasharrajat well out of the newly deployed PRs on the checklist, this one seems like the most likely candidate to have caused a regression here, because it's the only one that altered related code such as OptionListUtils.
Maybe it's another beta issue
I'm also unable to reproduce on my side. Asking the same tester who reported this if he can still repro.
I will check it Rory. Thanks for pointing it out.
Also, it might be useful to know if it's only reproducible only for the New Group page or also for Search and/or New Chat
Figured it out (I think). You have to search for one of the users that are currently included in the recents list. @roryabraham Let me know if that works for you and I'll add it to the Action performed.

Issue is also reproducible in production. Removing the blocker label.

Since this is no longer a time-sensitive deploy blocker, I'm going to unassign myself for now.
Actually, I'm not sure if he's a member of the CME team, so I'm going to do something else.
Triggered auto assignment to @MitchExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
@roryabraham This is not a regression from my PR. this issue exists before that PR was merged. I believe this change was not implemented correctly.
Ok, I have found the issue. @isagoico is correct it's related to the recent Chats list.
Proposal
- We need to change the condition here as it is not considering recentChats at all. https://github.com/Expensify/App/blob/8c60189870b91ebaa80e100fa4c89d5f6d778c61/src/pages/NewChatPage.js#L132
to
(this.state.personalDetails.length + this.state.recentReports.length) !== 0,
Group page and search page already have this condition.
Gotcha, so this is only an issue for the New Chat page, not search or New Group. @parasharrajat your proposal looks good. @MitchExpensify Please hire @parasharrajat on Upwork, and @parasharrajat feel free to submit a PR.
@parasharrajat Tangentially related, but IMO there is too much duplicated code between NewChatPage and NewGroupPage, and also partially SearchPage. I would be willing to pay a small bonus if you spend some time DRYing up that code. Up to you!
Sure, I will refactor it.