Skip to content

fix: generate UUID when member identity id is empty on create - #4341

Merged
skwowet merged 2 commits into
mainfrom
fix/member-identity-empty-id
Jul 15, 2026
Merged

fix: generate UUID when member identity id is empty on create#4341
skwowet merged 2 commits into
mainfrom
fix/member-identity-empty-id

Conversation

@skwowet

@skwowet skwowet commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes 500 errors on PUT /member/:memberId/identity when users add identities from the Contributor UI. New identity rows were sent with id: "", which bypassed ?? generateUUIDv1() and caused Postgres to reject the insert (invalid input syntax for type uuid: "").

Changes

  • DAL (services/libs/data-access-layer/src/members/identities.ts): Use i.id || generateUUIDv1() in insertMemberIdentities so empty/falsy ids get a generated UUID.
  • Frontend (contributor-identity-add.vue): Strip id from the create payload so new identities are sent without an id, matching the NewMemberIdentity contract.

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet self-assigned this Jul 15, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 08:11
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes identity creation failures by preventing empty UUIDs from reaching PostgreSQL.

Changes:

  • Generates a UUID for missing or empty identity IDs in the DAL.
  • Adds a dedicated frontend creation type and omits IDs from create requests.
  • Updates store and API-service contracts accordingly.

Review note: The PR title is missing the required JIRA key suffix, such as (CM-1234).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/libs/data-access-layer/src/members/identities.ts Handles empty IDs defensively.
frontend/src/modules/contributor/types/Contributor.ts Defines the create payload type.
frontend/src/modules/contributor/store/contributor.actions.ts Applies the create type to the store action.
frontend/src/modules/contributor/services/contributor.identities.api.service.ts Applies the create type to the API request.
frontend/src/modules/contributor/components/edit/identity/contributor-identity-add.vue Removes IDs from submitted identities.

💡 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>
Copilot AI review requested due to automatic review settings July 15, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@skwowet
skwowet merged commit 0d8c6c6 into main Jul 15, 2026
14 checks passed
@skwowet
skwowet deleted the fix/member-identity-empty-id branch July 15, 2026 08:32
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