Skip to content

[bug] import --auto-collection-routing creates duplicate collection nodes (multiple per name) #1703

Closed

Description

@mstomar125

Found while load-testing tenant_demo (the imported nodespace-docs).

Symptom

tenant_demo has 98 collection nodes but only 18 distinct collection names — ~5–8 duplicate collection nodes per name:

  • Architecture ×8, .claude ×7, Alternatives ×7, Components, Decisions, Development, Docs, References, Research, Standards, Strategy, … (the docs folder structure), plus T4 Collection.

So nodespace import dir ../nodespace-docs --auto-collection-routing (see CLAUDE.md) creates a new collection node for a given name/path on each occurrence (per subdirectory match and/or per re-import run) instead of reusing an existing collection with that name/path.

Impact

  • Sidebar/collection tree shows (or would show) many duplicate collections with identical names.
  • Content is split across duplicate collections, so a "collection" the user thinks is one thing is actually several.

Expected

--auto-collection-routing should resolve an existing collection by name/path (find-or-create) and route content into the single canonical collection, rather than minting duplicates. Re-importing the same tree should be idempotent (no new duplicate collections).

Notes

  • Likely lives in the import / auto-collection-routing path (core CLI/import).
  • Dedup key should be the collection path (the routing already derives a path), not a fresh id per match.

Activity

  1. added
    bug
    on Jul 20, 2026
  2. mstomar125 commented on Jul 20, 2026

    @mstomar125
    ContributorAuthor

    Second facet found during the same load test: imported sub-collections are invisible in the sidebar (no membership)

    Ground-truthed against tenant_demo synced to a fresh device as [email protected] (person 993a1c99):

    • The 18 imported collections (Architecture, Components, Decisions, Docs, …) are member_of the Default/root collection c0000000-0000-0000-0000-000000000001 (which in this tenant is named "T4 Collection"). Their content nodes sync fine (reachable via the open root).
    • BUT no member_of edge links a person to any of them — demo@ is a member of 0 collections. Query: SELECT ... FROM relationship WHERE relationship_type='member_of' AND out_node=<person> → empty.
    • Result: the sidebar (get_all_collections, which returns collections the caller is a member of + the default) shows only "T4 Collection" even though all 18 collection nodes are local and their content is present.

    So --auto-collection-routing creates the sub-collection nodes and links them to the root, but never stamps the importing user (or any person) as a member → the collections are undiscoverable in the UI despite being fully synced.

    Two distinct problems on this issue now

    1. Duplicates — multiple collection nodes per name (original report).
    2. No membership on import — imported collections have no person member_of edge, so they don't surface in the collection sidebar. Either the import should add the importer as a member, and/or the sidebar should also surface collections that are member_of the root (open) regardless of explicit membership.
  3. self-assigned this
    on Jul 20, 2026
  4. mstomar125 commented on Jul 20, 2026

    @mstomar125
    ContributorAuthor

    Facet 1 (duplicate collection nodes — this issue's title) is resolved by #1704 (merged, 6d7985e): collection ids are now deterministic (UUIDv5 of the normalized name) across the import AND the interactive create paths, so independent devices/re-imports converge on one node per name. Facet 2 (imported/nested collections have no person member_of edge → invisible in the sidebar) is split out to #1705. Closing this issue as the duplicates facet is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions