fix: return conflict for duplicate verified member identities (CM-1133)#4062
Merged
fix: return conflict for duplicate verified member identities (CM-1133)#4062
Conversation
… api Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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
409response for the identity verification endpoint inopenapi.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.
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.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
409 Conflictwhen verifying a member identity that is already verified on another member.500responses for expected identity conflicts.409response 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
500errors by catching the DB unique-constraint violation duringverifyMemberIdentityand returning a409 Conflict(ConflictError) when an identity is already verified on another member.Updates the public
openapi.yamlspec forPATCH /members/{memberId}/identities/{identityId}to document the new409response and example payload.Reviewed by Cursor Bugbot for commit d2b93a5. Bugbot is set up for automated code reviews on this repo. Configure here.