Skip to content

fix: refresh affiliation on update (CM-1118)#4020

Merged
ulemons merged 5 commits intomainfrom
fix/refresh-affiliation-on-update
Apr 15, 2026
Merged

fix: refresh affiliation on update (CM-1118)#4020
ulemons merged 5 commits intomainfrom
fix/refresh-affiliation-on-update

Conversation

@ulemons
Copy link
Copy Markdown
Contributor

@ulemons ulemons commented Apr 14, 2026

Note

Medium Risk
Adds a new post-update Temporal-driven affiliation recalculation step based on changed member organizations; incorrect org ID collection or job triggering could cause missed or excess recalculations and added load.

Overview
When enrichment updates a member, the worker now tracks which organization affiliations were affected by work-experience deletes/creates/updates.

After the DB transaction completes, it uses CommonMemberService.startAffiliationRecalculation to recompute affiliations for the member and the deduped set of affected org IDs, while preserving the existing didUpdate/updatedAt vs lastTriedAt behavior.

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

ulemons added 2 commits April 14, 2026 15:39
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons requested a review from joanagmaia April 14, 2026 13:42
@ulemons ulemons self-assigned this Apr 14, 2026
Copilot AI review requested due to automatic review settings April 14, 2026 13:42
@ulemons ulemons added the Bug Created by Linear-GitHub Sync label Apr 14, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 ensures member affiliations are recalculated when the members enrichment worker updates a member’s work experiences (memberOrganizations), addressing cases where affiliation state could otherwise remain stale after enrichment-driven updates.

Changes:

  • Track organization IDs affected by work experience deletes/creates/updates during enrichment.
  • Trigger CommonMemberService.startAffiliationRecalculation(...) after the transaction completes to refresh affiliations.

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

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8497e07. Configure here.

ulemons added 2 commits April 14, 2026 16:05
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copy link
Copy Markdown
Contributor

@joanagmaia joanagmaia left a comment

Choose a reason for hiding this comment

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

@skwowet fyi this is a critical issue in production we noticed today. Tagging you for visibility

@skwowet
Copy link
Copy Markdown
Collaborator

skwowet commented Apr 14, 2026

@joanagmaia Thanks for the heads-up and also, good catch!

@skwowet skwowet self-requested a review April 14, 2026 19:20
@ulemons ulemons merged commit 141bc2b into main Apr 15, 2026
16 of 17 checks passed
@ulemons ulemons deleted the fix/refresh-affiliation-on-update branch April 15, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants