bobbai00 commented on code in PR #8701:
URL: https://github.com/apache/texera/pull/8701#discussion_r4333332182
##########
frontend/src/app/dashboard/component/user/search-bar/search-bar.component.ts:
##########
@@ -107,12 +107,15 @@ export class SearchBarComponent {
this.includePublic
);
+ // A failed request or a row convertToName cannot name costs this query
its suggestions, not the
+ // subscription in the constructor, which would otherwise end and leave
autocomplete dead for the session.
return searchObservable.pipe(
switchMap((result: SearchResult) => {
const uniqueResults = Array.from(new Set(result.results.map(item =>
this.convertToName(item))));
this.addToCache(query, uniqueResults);
return of(uniqueResults);
- })
+ }),
+ catchError(() => of([]))
Review Comment:
**Advisory:**
This catch also swallows `convertToName`'s throw. So the kind drift the
description predicts would show as an empty dropdown with nothing logged; on
main it reached the console, which is how #8700 was found.
[`FiltersComponent`](https://github.com/apache/texera/blob/242daebff3451c9bd1c284b625bc2d0eb14a58d4/frontend/src/app/dashboard/component/user/filters/filters.component.ts#L211)
only wraps the request. I'd remove the second list instead: reuse the payload
lookup at `search.service.ts:250` in the filter (`:109`) and in
`convertToName`, so they cannot disagree.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]