With more than 50 tasks, there’s a split into pages. But when I add subtasks, they show up on the next page, not under the parent, but as single tasks.
Are the subtasks shown correctly under their parents on the main page? Or are they only shown on the next page?
I created a test project (see attachments) with 14 parent tasks and 5 subtasks each (from 1 to 10). Everything works fine - until the number of tasks in the project reaches 50. From then on, subtasks are not shown under their parent tasks any longer, but on the next page.
As a quick fix, could you give an option in the settings to disable the pagination?
Disabling pagination is unfortunately not really easy, because it’s baked in deeply into the web handling framework.
I’ll look into a fix.
This should now be fixed in #2345 - feat(tasks): expand subtasks - vikunja - Gitea, please check with the next unstable build (should be ready for deployment in ~45min, also on try).
@kolaente I believe this issue wasn’t fully resolved back in the day.
Environment
- Setup: Environment built on the latest
main
branch - Also confirmed on: “try” instance
Steps to Reproduce
-
For better visibility, modify line 57 of
SingleTaskInProject.vue
as follows:
{{ task.title + ' ' + task.position }}
-
Create an empty project.
-
Create 45 tasks in this project.
-
Drag the 44th task to the last position (45th).
-
Observe the significant position value increase.
-
Repeat at least 5 times: drag 44th task to last position (45th).
-
Make the 45th task a subtask of the 5th task.
-
Add a few more tasks as subtasks of the 5th task.
-
Add more tasks to the project until the pagination footer appears, ensuring the next page has ~10 tasks.
Expected Result
- Page 1 contains 53 tasks:
- 50 parent tasks (including the 5th)
- 3 subtasks of the 5th task
- Page 2 contains some of the initially created tasks, but no subtasks.
- New tasks push out older tasks to the next page, but subtasks of the 5th task remain with it on Page 1, regardless of their order.
Actual Result
- Page 1 contains only 50 tasks:
- 48 parent tasks (including the 5th)
- 2 subtasks of the 5th task
- Page 2 contains:
- The 3rd subtask with bloated position (which did not stick with the 5th parent task).
- The task used to bloat its position value.
- Some of the initially created tasks.
Developer Details
A fix was introduced as part of #2345 to adjust DB queries so that:
- The 50 parent tasks per page would be combined with their subtasks.
- This would allow the List view to display more than 50 tasks in total.
However, an analysis of the backend GET request shows that only 50 tasks are still being returned. This suggests that:
- Something above the DB query layer is still limiting the result set to 50 tasks, despite the DB returning more (haven’t validated, but I assume DB query works as expected).
Kind of obvious observations worth to mention:
- Sorting is done based on task.position.
- When a task with a bloated position value becomes a subtask, its position remains unchanged, regardless of its new hierarchy.
Possible Solutions
- Allow more than 50 tasks to pass through if the DB query is working as expected.
- Alternative approach:
- Load all applicable parent tasks for the List view.
- For each parent, fetch its applicable subtasks separately.
- Improve performance by first fetching parent IDs, then loading both parent task objects and subtask objects in parallel.
- Not as fast as the current method, but likely easier to maintain.
- Another potential fix:
- Make subtasks inherit the position of their parent (or adjust with a minor delta).
- However, this could introduce ambiguity if a subtask has two parents and those parents fall on different pages.
Thanks for reporting this, I’ll take a look.
@executed I’m unable to reproduce this with the latest demo. Does this only happen when you change the position of tasks?