Skip to content

fix: remove unnecessary grouped lookup in verify work experience#4317

Merged
skwowet merged 9 commits into
mainfrom
fix/cm-1266-hidden-work-exp-lookup
Jul 8, 2026
Merged

fix: remove unnecessary grouped lookup in verify work experience#4317
skwowet merged 9 commits into
mainfrom
fix/cm-1266-hidden-work-exp-lookup

Conversation

@skwowet

@skwowet skwowet commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up fix to CM-1266. Cleans up verifyMemberWorkExperience after the domains change accidentally added a pre-transaction grouped lookup that could block the handler before the transaction runs.

Clients call this endpoint with the display work experience ID returned by the list API, not hidden grouped row IDs.

Changes

  • Remove pre-transaction grouped lookup and extra NotFoundError check (the CM-1266 regression)
  • Keep row lookup on fetchMemberOrganizations only
  • Keep withDomains: true on the post-transaction response fetch
  • On reject (verified: false), stash org data before soft-delete and use grouped before-data for the response fallback (org name/logo/domains + merged dates/source)
  • Skip the pre-transaction fetch on verify (verified: true) since the row still exists post-transaction

Test plan

  • Staging smoke script (test-lfxOne-cdp-auth.sh) — verify, reject, grouping, domains

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

github-actions Bot commented Jul 8, 2026

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

This PR fixes a regression in the public members work-experience APIs where actions on hidden/overlapping work-experience rows could fail with Work experience not found due to ID lookup happening on grouped (display) data rather than the raw rows.

Changes:

  • Update verifyMemberWorkExperience to resolve the target work-experience row by ID from ungrouped org-enriched rows, while still returning grouped (display) data when available.
  • Update updateMemberWorkExperience to fall back to the ungrouped row when building the response for hidden IDs.

Reviewed changes

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

File Description
backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Switch ID lookup to ungrouped org-enriched rows; keep grouped response for visible rows with fallback for hidden IDs.
backend/src/api/public/v1/members/work-experiences/updateMemberWorkExperience.ts Response-building now falls back to the ungrouped row if the grouped (display) set cannot resolve the requested ID.

💡 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 8, 2026 08:31
@skwowet skwowet changed the title fix: avoid grouping when resolving work experience by id fix: remove unnecessary grouped lookup in verify work experience Jul 8, 2026

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
…data

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:47

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 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
…ation

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:57

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 09:01

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 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
…tion

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 09:12

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 1 out of 1 changed files in this pull request and generated no new comments.

skwowet added 2 commits July 8, 2026 15:05
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 09:36

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread backend/src/api/public/v1/members/work-experiences/verifyMemberWorkExperience.ts Outdated
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 10:05
@skwowet skwowet merged commit d7e9bb0 into main Jul 8, 2026
11 checks passed
@skwowet skwowet deleted the fix/cm-1266-hidden-work-exp-lookup branch July 8, 2026 10:05

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 1 out of 1 changed files in this pull request and generated no new comments.

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