Skip to content

fix: return conflict for duplicate verified member identities (CM-1133)#4062

Merged
skwowet merged 2 commits intomainfrom
bugfix/CM-1133
Apr 28, 2026
Merged

fix: return conflict for duplicate verified member identities (CM-1133)#4062
skwowet merged 2 commits intomainfrom
bugfix/CM-1133

Conversation

@skwowet
Copy link
Copy Markdown
Collaborator

@skwowet skwowet commented Apr 28, 2026

Summary

  • Return 409 Conflict when verifying a member identity that is already verified on another member.
  • Preserve the db uniqueness invariant while avoiding public API 500 responses for expected identity conflicts.
  • Document the new 409 response in the public OpenAPI spec.

Note

Low Risk
Low risk: changes are localized to member identity verification error handling and OpenAPI documentation, with no schema or workflow changes beyond mapping a known DB uniqueness violation to a 409 response.

Overview
Prevents expected duplicate-verified identity collisions from surfacing as 500 errors by catching the DB unique-constraint violation during verifyMemberIdentity and returning a 409 Conflict (ConflictError) when an identity is already verified on another member.

Updates the public openapi.yaml spec for PATCH /members/{memberId}/identities/{identityId} to document the new 409 response and example payload.

Reviewed by Cursor Bugbot for commit d2b93a5. Bugbot is set up for automated code reviews on this repo. Configure here.

… api

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet self-assigned this Apr 28, 2026
Copilot AI review requested due to automatic review settings April 28, 2026 11:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the public member-identity verification endpoint to return a 409 Conflict when an identity being verified is already verified on a different member, and documents that new response in the public OpenAPI spec.

Changes:

  • Add a conflict check before verifying a member identity to prevent “duplicate verified identity” situations.
  • Return ConflictError (HTTP 409) instead of allowing a DB uniqueness violation to surface as a 500 in the expected conflict case.
  • Document the new 409 response for the identity verification endpoint in openapi.yaml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
backend/src/api/public/v1/members/identities/verifyMemberIdentity.ts Adds a pre-check for already-verified identities on other members and throws ConflictError.
backend/src/api/public/openapi.yaml Documents the new 409 Conflict response for the identity verification PATCH endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/api/public/v1/members/identities/verifyMemberIdentity.ts Outdated
Comment thread backend/src/api/public/openapi.yaml
Comment thread backend/src/api/public/v1/members/identities/verifyMemberIdentity.ts Outdated
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet merged commit 208861b into main Apr 28, 2026
15 checks passed
@skwowet skwowet deleted the bugfix/CM-1133 branch April 28, 2026 13:02
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.

2 participants