Inconsistent filter results with subtasks (assignees filter returns non-matching tasks and excludes matching ones)

Environment:
Vikunja v2.2.0 (Docker)
Postgres + Redis
No Typesense

Expected behavior: Filtering tasks by assignee should return only tasks assigned to that user.

Example filter: assignees in user1 && done = false

Expected result: Only tasks or subtasks assigned to user1 are returned.

Actual behavior: Filter results appear inconsistent across task branches:

Some parent tasks are included together with all subtasks, including subtasks that do not match the filter
Other parent tasks are excluded entirely, even when they contain subtasks that do match the filter

This results in both inclusion of non-matching tasks and exclusion of matching tasks

Minimal reproducible example:
Structure

Task 1
Task 1a (assigned to user1)
Task 1b (assigned to user2)
Task 2
Task 2a (assigned to user1)
Task 2b (assigned to user2)

Filter: assignees in user1

Result:
Task 2 is included with both subtasks, including non-matching Task 2b
Task 1 is excluded entirely, including matching Task 1a

Verification:
Confirmed via browser dev tools. The API request was of the form “/api/v1/projects/{id}/tasks?..&filter=assignees+in+user1”
The API response itself includes tasks that do not match the filter and omits tasks that do match, so this does not appear to be a frontend-only rendering issue.

Question: Is this expected behavior due to how Vikunja handles task trees, or is it a bug in filtering logic?
If it is intended behavior, is there any way to return only matching tasks, or apply consistent parent/child inclusion rules?

Notes:
Issue persists even with only 2 levels of hierarchy
Tested with a simple minimal project structure
Does not appear to be a filter syntax issue

Just as a followup, I can confirm that other simple filters such as “done = false” also fail in the presence of subtasks.

I created another small test project and instead of using subtasks under a parent task I created a single layer of tasks under a subproject. In this configuration the filters achieve the expected result.

Is this known behaviour in a project structure containing subtasks or potentially a bug or configuration/installation issue?

Thanks!

In case this helps anyone else, I could not get Vikunja to handle a project structure with any complexity. I need to have nested projects, tasks and subtasks and the platform does not appear to support this in terms of either filters or use of templates. I moved on to a different platform that does work well in this regard.