aglinxinyuan commented on code in PR #7463:
URL: https://github.com/apache/texera/pull/7463#discussion_r3885760755
##########
frontend/src/app/dashboard/service/user/search.service.ts:
##########
@@ -84,9 +84,22 @@ export class SearchService {
const finalIncludePublic = isLogin ? includePublic : true;
- return this.http.get<SearchResult>(
- `${url}?${toQueryStrings(keywords, params, start, count, type,
orderBy)}&includePublic=${finalIncludePublic}`
- );
+ return this.http
+ .get<SearchResult>(
+ `${url}?${toQueryStrings(keywords, params, start, count, type,
orderBy)}&includePublic=${finalIncludePublic}`
+ )
+ .pipe(
+ map(result => ({
+ ...result,
+ // The unified-search response can carry resource types this client
does not model:
+ // rows from a feature being removed server-side later than here, or
a type the backend
+ // gains first. Both `convertToName` and `DashboardEntry` throw on
an unrecognised
+ // payload, and the autocomplete subscribes without an error
handler, so a single such
+ // row would otherwise kill the subscription for the rest of the
session. Dropping them
+ // at the funnel every consumer calls keeps a stale row merely
invisible.
+ results: result.results.filter(item => item.workflow != null ||
item.file != null || item.dataset != null),
Review Comment:
Confirmed and taken explicitly, in both places you suggested.
I verified the mechanism rather than assuming:
`SearchResultsComponent.loadMore` passes `this.entries.length` as the offset
(search-results.component.ts:97) and appends with no dedup, so a window holding
k dropped rows re-fetches k already-shown rows, and an all-dropped window
leaves the offset unmoved while `more` stays true. Only the "All" tab can
receive such rows — the typed tabs pass a concrete resourceType. (For the
record it is five callers of `SearchResultsComponent.reset`, not four: search,
user-dataset, user-model, user-workflow and hub-search-result.)
Not corrected here, for the reasons you gave: the fix belongs in the
`LoadMoreFunction` contract those five share, and #7464 removes the only thing
that produces such rows. Documented as a "Known trade-off" comment beside the
guard and as a paragraph in the PR description.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]