Skip to content

Short IDs not normalised when storing relationship links #49

@Isoceth

Description

@Isoceth

When setting parent or blocking relationships via CLI flags or GraphQL mutations, short IDs get stored verbatim in the frontmatter rather than being normalised to full IDs.

Reproduction:

beans update X --blocking camu      # stores blocking: [camu] → broken
beans update X --blocking beans-camu  # stores blocking: [beans-camu] → works

Same behaviour with --parent and the GraphQL mutations (addBlocking, setParent, etc.).

Root cause:
The bean(id:) query resolver already handles short ID → full ID normalisation via Core.Get(), but the mutations write the input ID directly without normalising first.

Affected mutations:

  • SetParent
  • AddBlocking
  • RemoveBlocking
  • CreateBean (parent and blocking fields)

I needed this fix myself so I put together a branch with tests: https://github.com/Isoceth/beans/tree/fix/short-id-normalization

Happy to open a PR if you'd like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions