fix: surface ticket creation failures to the client - #1
Open
bensofficial wants to merge 1 commit into
Open
Conversation
Ticket creation errors were caught and swallowed on the server, so the client received 201 Created and rendered "submitted successfully" even when no ticket was produced. The DB now stays uncommitted until the ticket succeeds, so a failed ticket rolls back the request row and returns 502, letting the existing client error UI kick in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
201 Createdand rendered "submitted successfully" even when the ticket system had failed.db.flush()instead ofdb.commit()) until the ticket succeeds. On a raised exception or a missing key from an enabled ticket system, a new shared helper (api/routes/_ticket.py) rolls back the pending INSERT and raisesHTTPException(502)so the client's existinghandleSubmissionFailureflow shows the red error toast.Noneandticket_system_enabledis false).Test plan
uv run ruff check .anduv run ty check .inserver/— I couldn't run these locally (uv not installed).handle_support_ticket_creation) and submit a support request. Expect the red "Submission failed" toast, not the green success card.🤖 Generated with Claude Code