Repository navigation
Conversation
…or RMA that does not exist PATCH/DELETE against PostgREST matching no row returns [], which the API passed through as a 200. Clients could not tell a missing record from a successful edit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0171zWznxrVFz2TZu8susXL5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Updating a nonexistent customer, device, ticket, or RMA, or deleting a nonexistent customer, previously returned HTTP 200 with
[]. The sharedrequire_rowhelper now returns HTTP 404 with a resource-specific message when the database mutation matches no row. Successful responses remain unchanged.Ticket updates check the mutation result before writing status history, including when a ticket disappears between the initial lookup and the update.
Related PRs and integration
This PR consolidates the missing-record behavior proposed in #45 (tickets) and #46 (customers, devices, and RMAs). Prefer this implementation as their replacement, retaining its post-mutation check for concurrent deletion. Those PRs remain open.
#75 adds UUID validation: malformed IDs should return 422, while valid UUIDs with no matching row return 404. The new missing-record tests use valid UUIDs.
Merge simulations against the reviewed branch tips found implementation conflicts with #45, #46, #73, #75, and #76; #72 conflicts only in test additions. #43 and #74 merge cleanly. When integrating #73/#75/#76, preserve their timestamp, UUID conversion, and optional-field normalization changes while keeping
require_rowaround the final database result.Validation
SUPABASE_URLandSUPABASE_KEYvalues (no live Supabase connection).ruff check .,ruff format --check ., andgit diff --checkpassed.SUPABASE_URLbeing configured; test: make get_headers test independent of SUPABASE_URL env #43 fixes that independently. No real credentials are required for these tests.