Push filtering, sorting and pagination into the database layer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
Research direction
Start by reading LearnStack.Core/Services/LearningResourceService.cs:12-21 and :74-96, then inspect Resources.razor:636-643 and Pulse.razor.cs:60. Trace how the current in-memory operations work before introducing the query/filter and paged-result design. Done means one query per resource-list page, one indexed duplicate-URL lookup, and no full-library materialization for Pulse aggregates.
Written by the indexing model from the issue text.
Description
Tier 2 — scale
Problem
GetAllAsync(userId) loads a user's entire library into memory (thumbnails included); the component then filters, sorts and pages it client-side. UrlExistsAsync loads every URL a user owns just to compare one. Pulse loads everything to compute aggregates. This is fine at 50 resources and collapses at 5,000.
Evidence
LearnStack.Core/Services/LearningResourceService.cs:12-21—GetAllAsyncLearnStack.Core/Services/LearningResourceService.cs:74-96—UrlExistsAsyncmaterializes all URLsLearnStack/Components/Pages/Resources.razor:636-643— in-memory pagingLearnStack/Components/Pages/Pulse.razor.cs:60— loads all resources for aggregates
Proposed fix
- Introduce a query/filter object and return a paged result (
Items,TotalCount) from the service. - Apply search, status/type/priority filters, sorting and
Skip/TakeinIQueryable. - Add a persisted
NormalizedUrlcolumn with a unique index per user, and replaceUrlExistsAsyncwith a single indexed lookup. - Compute Pulse aggregates with
GroupByin SQL rather than in memory.
Acceptance criteria
- Resource list issues one query per page regardless of library size
- Duplicate-URL check is a single indexed query
- Pulse does not materialize the full library
- Dominant language
- HTML
- Stars
- 10
- Forks
- 0
- Avg merge
- 3h 42m
- Merged PRs (30d)
- 14
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kasuken/LearnStack
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 91/100
kasuken/LearnStack#59 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
kasuken/LearnStack#72 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
kasuken/LearnStack#71 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
kasuken/LearnStack#70 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
kasuken/LearnStack#69 ·
Maintainers usually reply within 1 day
All issues in kasuken/LearnStack
Similar issues
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GNS3/gns3-server#2935 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
TauricResearch/TradingAgents#1476 ·
Maintainers usually reply within 2 days
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pingdotgg/t3code#15221 · 1 comment ·
Maintainers usually reply within 1 day
-
🕷️ bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sysadminsmedia/homebox#1770 ·
Maintainers usually reply within 2 days
-
API bug connectors
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
pyinfra-dev/pyinfra#1986 ·
Maintainers usually reply within 3 days