Repository navigation
Conversation
Path ids for customers, devices, tickets, notes, history and RMAs were typed as plain strings, so a non-UUID value (stale link, typo, crafted input) was sent straight to Supabase. Postgres rejects it for a uuid column with a 400, which handle_response turns into a 503 "temporarily unavailable" with Retry-After: 30 - telling clients to retry a request that can never succeed. Typing these params as UUID makes FastAPI return 422 before any DB call, which also means crafted ids never reach a PostgREST filter. Tests now use real UUID fixtures, and the id-escaping tests assert the 422. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0171zWzo22EqdMY1jm7ohaqw
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 15, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
{id}path parameters on/customers,/devices,/tickets(including/notesand/history) and/rmaswere typed asstr, so a non-UUID value from a stale link, a typo or crafted input went straight to Supabase. Postgres rejects that value for auuidcolumn with a 400.handle_responsethen turns the 400 into a 503 "temporarily unavailable" withRetry-After: 30, so clients are told to retry a request that can never succeed. For example,GET /tickets/abcreturned a 503 instead of a client error.These params are now typed as
UUID, so FastAPI returns 422 before any DB call. As a side effect, crafted ids no longer reach a PostgREST filter at all. Escaping from #19 is kept as defence in depth. The frontend only sends DB-issued UUIDs, so its behaviour doesn't change.No open PR (#17–#74) or issue covers malformed ids. Related but distinct:
ticket_idinai.py. This PR doesn't touchai.pyor theAISuggestRequestbody.Testing
t1/c1etc.pytest: 63 passed (withSUPABASE_URL/SUPABASE_KEYset).ruff checkandruff format --checkare clean.Generated by Claude Code