fix: allow UUID version 1-8 as filter values#1486
Conversation
Summary by CodeRabbit
WalkthroughThe π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
β¨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
π Steps to fix this
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/hooks/filter-utils.ts`:
- Around line 218-219: The UUID_PATTERN regex in the backend parseUuidTerm
function currently restricts validation to UUID versions 1-5 using [1-5], but
the UI has been updated to accept versions 1-8 using [1-8]. This mismatch causes
valid UUIDv6/7/8 values to pass UI validation but then fail at the backend,
breaking filter queries. Update the UUID_PATTERN regex in the parseUuidTerm
validation to use [1-8] instead of [1-5] to match the UI validation contract and
ensure consistency across both layers.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c749f856-4cb0-439a-baf1-ebb5621c70f6
π Files selected for processing (2)
ui/hooks/filter-utils.test.tsui/hooks/filter-utils.ts
| const UUID_PATTERN = | ||
| /^[\da-f]{8}-[\da-f]{4}-[1-5][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i; | ||
| /^[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i; |
There was a problem hiding this comment.
π§© Analysis chain
π Script executed:
#!/bin/bash
# Verify all UUID_PATTERN definitions in the codebase
rg -n 'UUID_PATTERN\s*=' --type ts -A 1Repository: prisma/studio
Length of output: 368
Backend UUID validation still restricts to versions 1β5, breaking UUIDv6/7/8 filters.
The UI regex was widened to [1-8] but data/full-table-search.ts (lines 27β29) still uses [1-5]. This causes valid UUIDv6/7/8 values to pass UI validation and then fail at the backend parseUuidTerm function, breaking filter queries.
Update UUID_PATTERN in data/full-table-search.ts to [1-8] to match the UI validation contract.
π€ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ui/hooks/filter-utils.ts` around lines 218 - 219, The UUID_PATTERN regex in
the backend parseUuidTerm function currently restricts validation to UUID
versions 1-5 using [1-5], but the UI has been updated to accept versions 1-8
using [1-8]. This mismatch causes valid UUIDv6/7/8 values to pass UI validation
but then fail at the backend, breaking filter queries. Update the UUID_PATTERN
regex in the parseUuidTerm validation to use [1-8] instead of [1-5] to match the
UI validation contract and ensure consistency across both layers.
fixes #1485