Skip to content

Fix filter scoping for Home Screen Sections queries#121

Closed
EclipseKnight wants to merge 1 commit intolostb1t:mainfrom
EclipseKnight:fix/api-listing-filter-scope
Closed

Fix filter scoping for Home Screen Sections queries#121
EclipseKnight wants to merge 1 commit intolostb1t:mainfrom
EclipseKnight:fix/api-listing-filter-scope

Conversation

@EclipseKnight
Copy link

I tracked this to the filter guard in GelatoItemRepository.ApplyFilters.

This regression appears tied to commit 1cb8d57 (refactor: filter out streams on everything except single item queries), which changed the guard to rely on IsSingleItemList().

The old check used !ctx.IsSingleItemList(), and IsSingleItemList() depends on this block in Common.cs:

var q = ctx.Request.Query;
if (!q.TryGetValue("ids", out var idsRaw))
    return false;

Home Screen Sections does not use ids for these calls, so those requests were treated like normal listings and got over-filtered, which resulted in slow loading and timeouts.

I changed the guard to ctx.IsApiListing() and added isSingleItemQuery = filter.ItemIds is { Length: 1 }. Filters now apply only when ctx.IsApiListing() && !isSingleItemQuery.

This keeps listing filters on real listing endpoints and fixes Home Screen Sections latest rows loading correctly.

@EclipseKnight
Copy link
Author

Closing this in favor of #122, which consolidates the filter scope fix and the Home Screen Sections listing-action update in one PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant