Skip to content

[shots] Return 404 on a malformed shot id#1150

Merged
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-shots-invalid-id
Jul 10, 2026
Merged

[shots] Return 404 on a malformed shot id#1150
frankrousseau merged 1 commit into
cgwire:mainfrom
frankrousseau:fix-shots-invalid-id

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problems

  • GET /data/shots/ (e.g. /data/shots/undefined) reached the database and raised StatementError as an unhandled 500.

Solutions

  • Validate the id in get_full_shot and raise ShotNotFoundException (404), matching get_shot_raw.

get_full_shot builds a hand-written query through get_shots_and_tasks,
bypassing the UUID casting guard, so a non-UUID path segment (e.g.
/data/shots/undefined) reached the database and raised StatementError
as an unhandled 500. Validate the id up front and raise
ShotNotFoundException, matching get_shot_raw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit fb4c3a5 into cgwire:main Jul 10, 2026
4 of 14 checks passed
@frankrousseau
frankrousseau deleted the fix-shots-invalid-id branch July 10, 2026 12:46
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