Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/hooks/filter-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ describe("filter syntax validation", () => {
["role", "=", "admin"],
["role", "ilike", "%adm%"],
["id", "=", "4f9d4af6-3ce2-4f3d-b4e6-cf8d0f510d4a"],
["id", "=", "019d6991-4380-76ba-b4eb-35c36b72d7f2"],
["attachment", "!=", "0xDEADBEEF"],
["enabled", "=", "true"],
["score", ">", "12.5"],
Expand Down
2 changes: 1 addition & 1 deletion ui/hooks/filter-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const TEXT_MATCH_OPERATORS = new Set<FilterOperator>([
"not like",
]);
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;
Comment on lines 218 to +219

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all UUID_PATTERN definitions in the codebase
rg -n 'UUID_PATTERN\s*=' --type ts -A 1

Repository: 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.


type ColumnSyntaxKind =
| "array"
Expand Down