Skip to content

[bug] Recursive collection members CTE follows has_child, not member_of — sub-collection members silently dropped #1426

Closed

Description

@mstomar125

Severity: high · Confidence: high (verified)

get_collection_members_recursive (packages/core/src/db/sqlite_store.rs:3279-3288) descends the collection subtree with WHERE r.relationship_type = 'has_child', but collection hierarchy is built from member_of edges (collection_service.rs:336/341/346). The recursive arm therefore matches nothing → coll_subtree only ever contains the seed → only the direct members of the seed collection are returned; every sub-collection's members are silently omitted. Contradicts the doc ("members of the collection or any descendant collections").

Fix: recursive arm should follow member_of parent→child: SELECT r.in_node ... WHERE r.relationship_type='member_of' AND r.out_node = cs.node_id; add a depth cap.


Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.

Activity

  1. mstomar125 commented on Jun 24, 2026

    @mstomar125
    ContributorAuthor

    Resolved in #1457. The recursive arm of get_collection_members_recursive now descends member_of parent→child (out_node→in_node), restricted to collection children with a depth cap, instead of has_child (which matched nothing) — so sub-collection members are no longer dropped. Test: a member of a sub-collection is returned for the parent. Full core suite green.

  2. added a commit that references this issue on Jun 24, 2026
    29d5936
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions