Yicong-Huang commented on code in PR #7463:
URL: https://github.com/apache/texera/pull/7463#discussion_r3885750529
##########
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:
Right seam, and the test pins it. One consequence is worth a decision.
This drops rows the server counted against `offset`/`limit`. But
`SearchResultsComponent.loadMore` still starts the next page at
`this.entries.length` (`search-results.component.ts:97`) and appends without
dedup.
So on the "All" tab a window holding k project rows re-fetches k
already-shown rows. A window that is all project rows leaves `entries.length`
unmoved: "Load more" re-requests the same window while `more` stays true, and
adds nothing. The search bar and the typed tabs are unaffected.
Not a blocker — the fix lives in `LoadMoreFunction`'s contract, shared by
four components, and #7461 ends the condition. Worth taking explicitly though;
a line here or in the description would do.
--
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]