-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2025-01-02] [$250] Search - Search loads infinitely when search query contains type:chat and category query #52907
Comments
Triggered auto assignment to @Christinadobrzyn ( |
Edited by proposal-police: This proposal was edited at 2024-11-21T21:22:56Z. ProposalPlease re-state the problem that we are trying to solve in this issue.Search loads infinitely. What is the root cause of that problem?The API Search with the above query returns error When Search API fails, we just update the loading to false App/src/libs/actions/Search.ts Line 45 in 4c44827
that make the condition App/src/components/Search/index.tsx Lines 190 to 195 in 4c44827
so we can see the loading state What changes do you think we should make in order to solve the problem?Solution 1: Add failure data within error in App/src/libs/actions/Search.ts Line 51 in 4c44827
then in Search.tsx, detect if Solution 2: Add failure data within data: [], status, and type
then the empty state will be shown What alternative solutions did you explore? (Optional)NA |
Job added to Upwork: https://www.upwork.com/jobs/~021859790661845309370 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Search - Search loads infinitely when search query contains type:chat and category query What is the root cause of that problem?The App/src/components/Search/index.tsx Lines 190 to 195 in 5f483dc
shouldShowLoadingState is true because searchResults?.search?.status is undefined .According to this below logic, we are showing the infinite loading component. App/src/components/Search/index.tsx Lines 274 to 281 in 5f483dc
What changes do you think we should make in order to solve the problem?We have to add the
What alternative solutions did you explore? (Optional)Or the backend should send the correct result in Contributor detailsYour Expensify account email: [email protected] |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Edited by proposal-police: This proposal was edited at 2024-11-29 04:40:23 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Search loads infinitely when search query contains type:chat and category query What is the root cause of that problem?This issue occurred because we sent incorrect parameters to the Search API. On the backend, there is parameter validation that returns a 402 error code. For example, if So, the backend response App/src/components/Search/index.tsx Lines 194 to 199 in 754a11c
For example, the backend returns a 402 error: Because this query is only correct for type:expense What changes do you think we should make in order to solve the problem?To resolve this issue, we should check if function buildSearchQueryString(queryJSON?: SearchQueryJSON) {
...
// src/libs/SearchQueryUtils.ts#L313
for (const filter of filters) {
+ const includeQuotes =
+ queryParts.some((item) => item === 'type:chat') &&
+ (filter.key === FILTER_KEYS.CATEGORY ||
+ filter.key === FILTER_KEYS.EXPENSE_TYPE ||
+ filter.key === FILTER_KEYS.TAG ||
+ filter.key === FILTER_KEYS.TAX_RATE ||
+ filter.key === FILTER_KEYS.DESCRIPTION ||
+ filter.key === FILTER_KEYS.MERCHANT ||
+ filter.key === FILTER_KEYS.CARD_ID ||
+ filter.key === FILTER_KEYS.CURRENCY);
const filterValueString = buildFilterValuesString(filter.key, filter.filters);
+ if (includeQuotes) {
+ queryParts.push(`"${filterValueString}"`.replace(/\s+/g, ''));
+ } else {
queryParts.push(filterValueString);
+ }
}
return queryParts.join(' ');
} Note: if other type (trip or ...) same with that case, then we able reuse this solution. Test branchPOCScreen.Recording.2024-11-25.at.15.43.11.movWhat alternative solutions did you explore? (Optional)To resolve this issue, we need to do two things:
App/src/components/Search/index.tsx Line 308 in 9933888 //src/components/Search/index.tsx#L308
+ if (searchResults === undefined && !isOffline) {
+ setShouldShowStatusBarLoading(false);
+ return (
+ <View style={[shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3, styles.flex1]}>
+ <EmptySearchView type={type} />
+ </View>
+ );
+ } |
@Christinadobrzyn, @alitoshmatov Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@alitoshmatov can you review these proposals? Thanks! |
@daledah I assume you meant |
@Anaslancer Thank you for your proposal, your solution is the same as @daledah 's. |
@huult Thank you for detailed proposal, your RCA is correct. But I don't think your solution is future-proof, your solution does solve this issue, but when backend responds with another error the same thing happens again. |
@alitoshmatov Thank you for your feedback. This issue occurred because the app sent a query with incorrect syntax to the backend, which the backend could not process, resulting in an error. Therefore, I think we should validate the query to ensure the correct syntax is sent to the backend. With this approach, we can perform the search; if not, we can handle the error by hiding the loading indicator and showing a 'not found' message. However, this might introduce a new issue where the category is sent, but the search result is 'not found'.
With this concern, I suggest we confirm with the internal team to get information about the filter key that the backend can support. For example: type = expense support key: category, tag... to we can create the correct query syntax. @alitoshmatov If you agree with this, we can discuss it in detail and define the next steps |
Proposal updated
|
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@alitoshmatov I think we can show the error at the end of search page same as what we did for form. We can get some thoughts from design team. What do you think? |
@Christinadobrzyn, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too... |
I think that's fine, but maybe we want to display a |
@Julesssss, @luacmartins, @alitoshmatov Just to understand, we're thinking this is the flow?
|
Yeah I agree. I might advocate for updating that copy to something like "Try adjusting your search criteria or creating something with the green + button." for all of these nothing found screens though. |
Amazing! Thanks @shawnborton and @dannymcclain! Jules does this sound good to move forward with #52907 (comment) |
Love the mock and great suggestion Danny 👍 |
@Christinadobrzyn yeah, this sounds good to me. Assigning now. |
📣 @daledah 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Several people 👍 this so I assume we are also implementing it. @daledah Please update Please respond if copy should be something different |
Just a heads up that I'm going to be ooo Dec 12 - 13th. Back on Monday 16th. I'm not going to assign this to a BZ teammate but if anything is urgent, please reach out to the team for a volunteer. |
Issue not reproducible during KI retests. (First week) |
Issue is still reproducable with |
hi @alitoshmatov and @daledah just checking on the PR for this. Can you provide an update? |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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 2025-01-02. 🎊 For reference, here are some details about the assignees on this issue:
|
@alitoshmatov @Christinadobrzyn @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
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.65-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Search will not load infinitely.
Actual Result:
Search loads infinitely.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6671890_1732196532024.20241121_212559.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ChristinadobrzynThe text was updated successfully, but these errors were encountered: