Skip to content

fix: normalise short IDs when storing relationship links#50

Merged
hmans merged 1 commit intohmans:mainfrom
Isoceth:fix/short-id-normalization
Jan 12, 2026
Merged

fix: normalise short IDs when storing relationship links#50
hmans merged 1 commit intohmans:mainfrom
Isoceth:fix/short-id-normalization

Conversation

@Isoceth
Copy link
Copy Markdown
Contributor

@Isoceth Isoceth commented Jan 10, 2026

Fixes #49

Short IDs were being stored verbatim in relationship fields (parent, blocking), causing resolution failures since the resolver expects full IDs.

Changes

  • Add NormalizeID() helper to Core that resolves short IDs to full IDs
  • Update SetParent, AddBlocking, RemoveBlocking mutations to normalise IDs before storing
  • Update CreateBean mutation to normalise parent and blocking IDs
  • Add tests for short ID normalisation

Note: This prevents the issue going forward. Existing broken links from short IDs could potentially be healed by extending beans check --fix to normalise resolvable short IDs, but that felt like separate scope.

Short IDs (e.g., "abc1") were being stored verbatim in relationship
fields (parent, blocking), causing resolution failures since the
resolver expects full IDs (e.g., "beans-abc1").

- Add NormalizeID() helper to Core that resolves short IDs to full IDs
- Update SetParent, AddBlocking, RemoveBlocking mutations to normalize
- Update CreateBean mutation to normalize parent and blocking IDs
- Add comprehensive tests for short ID normalization
@hmans hmans self-assigned this Jan 12, 2026
@hmans hmans merged commit 2f47632 into hmans:main Jan 12, 2026
1 check passed
@hmans
Copy link
Copy Markdown
Owner

hmans commented Jan 12, 2026

Looking good, thank you!

hmans added a commit to divaltor/beans that referenced this pull request Jan 17, 2026
* origin/main:
  feat(tui): Two-column layout with detail preview (hmans#42)
  feat: add ETag support for optimistic concurrency control (hmans#59)
  feat(plugin): improve OpenCode plugin robustness with availability checks (hmans#58)
  feat(cli): Add --prefix flag to create command (hmans#56)
  chore: clean up README.md
  docs: only push prime if it exists (hmans#52)
  fix: normalise short IDs when storing relationship links (hmans#50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Short IDs not normalised when storing relationship links

2 participants