Content node tree advertises more children when a filter leaves none
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start in kolibri/core/content/viewsets/contentnode/tree.py around lines 216-230, where children.more is set by comparing rght values only, and check what the filtered child query returns after the page. The public v2 tree endpoint shares this code, so look there too. Done when children.more is null if no further child passes the filters, and still set when a thirteenth child does pass; verify with the tree endpoint tests.
Written by the indexing model from the issue text.
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: develop
Observed behavior
/api/content/contentnode_tree/<id>/setschildren.morewhenever a full page ends before the parent's last descendant, comparingrghtvalues only.- When the request's filters exclude every child after that page, the request built from
children.morereturns 200 with nochildrenkey. include_coach_content=false, which Learn sends for learners, does this for a topic whose 12 learner resources are followed by one coach resource.languages=esdoes it for 12eschildren followed by oneenchild./api/public/v2/contentnode_tree/<id>/shares the code.
Expected behavior
children.more is null when no further child passes the request's filters.
User-facing consequences
Learn reads data.children.results from the continuation without checking for children, in loadMoreContents, loadMoreTopics and TopicsContentPage.vue. A learner in such a topic is offered more resources that do not exist.
Steps to reproduce
- Create a topic with 13 child resources, the last one with
coach_content=True. GET /api/content/contentnode_tree/<topic id>/?include_coach_content=false.- The response holds 12 children, and
children.more.paramscarriesinclude_coach_content=false,depth=2and anext__gt. GETthe same URL with those params.- The response is 200 and has no
childrenkey.
Context
- Kolibri develop at 758605b764.
- SQLite, Django test client.
Acceptance Criteria
- For the topic in the steps above, the first response's
children.moreisnull. - The same holds for a child topic whose page of 12 grandchildren is followed only by filtered-out nodes.
- A topic with 13 children that all pass the filters still returns
children.more, and its continuation returns the thirteenth child. - Both hold on the local and the public v2 tree endpoints.
- A tree request issues no more queries than it does today when no page is full.
AI usage
Written by rtibblesbot, an LLM-based coding agent (Claude Code), which found this while reviewing the branch for #15043 and reproduced the responses above with Django's test client.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 1.1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 87
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 learningequality/kolibri
-
Setup wizard's "Responsibilities as an administrator" step throws when left within 200 ms of openingOpenAPP: Setup Wizard bug DEV: frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
learningequality/kolibri#16097 ·
Maintainers usually reply within 1 day
-
bug DEV: frontend
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
learningequality/kolibri#16050 ·
Maintainers usually reply within 1 day
-
APP: Learn bug DEV: frontend
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
learningequality/kolibri#16096 ·
Maintainers usually reply within 1 day
-
APP: Learn bug DEV: frontend
Difficulty 4/5 3-5 days Newbie friendliness 35/100
learningequality/kolibri#16095 ·
Maintainers usually reply within 1 day
-
APP: Learn bug DEV: frontend
Difficulty 3/5 1-2 days Newbie friendliness 35/100
learningequality/kolibri#16094 ·
Maintainers usually reply within 1 day
All issues in learningequality/kolibri
Similar issues
-
backend: claude chore dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
briandconnelly/amicus#606 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
semantica-agi/semantica#2320 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vllm-project/vllm-omni#11465 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jxxghp/MoviePilot#7699 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vllm-project/vllm-ascend#24010 ·
Maintainers usually reply within 1 day