Skip to content

Prevent Registration Race Conditions (409 Conflict) #6

Description

@viceda-s

Problem: AuthService.register() suffers from a Time-of-Check to Time-of-Use (TOCTOU) race condition, resulting in generic 500 errors if unique constraints are violated concurrently.

Acceptance Criteria:

  • Update GlobalExceptionHandler to explicitly catch DataIntegrityViolationException.
  • Map unique constraint violations (specifically on the users table email column) to a 409 Conflict HTTP response.
  • Adopt RFC 7807 (ProblemDetail) for all error responses instead of custom maps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions