Skip to content

Fix misleading conflict responses for unexpected database violations - #1

Merged
bconnell merged 9 commits into
mainfrom
fix/classify-database-integrity-failures-20261017
Oct 18, 2026
Merged

bconnell merged 9 commits into
mainfrom
fix/classify-database-integrity-failures-20261017

Conversation

@bconnell

@bconnell bconnell commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Problem

The API treated every DataIntegrityViolationException as a duplicate lead email and returned HTTP 409, even when the database failure involved another constraint.

Fix

  • Match the named uk_leads_email constraint, including the H2 backing-index form, before returning the existing email-conflict response.
  • Return a generic, safe 500 Problem Detail for other or unrecognized integrity violations.
  • Add HTTP regression coverage for real check-constraint failures against H2 and PostgreSQL.
  • Record the exact validation evidence and limits in the portfolio completeness report.

Validation completed on the final PR head

  • CI run 39081485357 completed successfully on 86583c6b14b6a5246935be57448e620aee3e6a55.
  • 40 application tests and 4 PostgreSQL Testcontainers integration tests passed. Zero failures, errors, or skips.
  • Spring Boot packaging, Docker Compose PostgreSQL readiness, and cleanup all passed.
  • Java 21 independent check of the constraint-name matcher accepted four expected formats and rejected five unrelated names.
  • Diff limited to the handler, its H2 and PostgreSQL HTTP tests, and the portfolio completeness report.
  • No production deployment, authentication, or performance promises are made.

Review and release

This change closes the integrity-failure classification defect identified in the portfolio completeness report. Merge only the validated head; future changes need fresh validation.

@bconnell
bconnell marked this pull request as ready for review October 18, 2026 00:07
@bconnell
bconnell merged commit 07a6d4f into main Oct 18, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T00:08:25.373520Z 86583c6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bconnell
bconnell deleted the fix/classify-database-integrity-failures-20261017 branch October 18, 2026 00:34
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