Skip to content

Fix Ecto.Query.CastError when querying issue by short ID#24

Open
nilszeilon wants to merge 5 commits intomainfrom
fix/sidebar-short-id-query
Open

Fix Ecto.Query.CastError when querying issue by short ID#24
nilszeilon wants to merge 5 commits intomainfrom
fix/sidebar-short-id-query

Conversation

@nilszeilon
Copy link
Copy Markdown
Owner

Summary

  • Fix Ecto.Query.CastError when querying issues by short ID (e.g., d668facb)
  • The issue was that get_issue_by_short_id/1 was using like/2 on a UUID field (binary_id), but Ecto couldn't cast the string pattern to binary_id
  • Fixed by using an Ecto fragment to cast the UUID to TEXT before applying the LIKE comparison

Fixes the API error:

value \`"d668facb"\` cannot be dumped to type :binary_id in query

The refresh button in the dashboard now shows visible 'Refresh' text
to make it accessible and match test expectations.
Allows API to accept short IDs like 'd668facb' in addition to full UUIDs.
When a short ID is passed, the issue is looked up by matching the first 8
characters of the UUID. Full UUIDs continue to work as before.
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.

1 participant