fix: filter soft-deleted - #4450
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 99ae148. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Adds tombstone handling intended to prevent enrichment from recreating manually deleted organization affiliations.
Changes:
- Returns soft-deleted organization IDs with member enrichment data.
- Filters tombstoned organizations from enrichment payloads.
- Adds shared types for deleted affiliations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
services/libs/types/src/enrichment.ts |
Adds deleted-organization types. |
services/libs/data-access-layer/src/old/apps/members_enrichment_worker/index.ts |
Queries soft-deleted affiliations. |
services/apps/members_enrichment_worker/src/activities/enrichment.ts |
Prevents tombstoned affiliations from being recreated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 99ae148. Configure here.

Summary
Fixes
members_enrichment_workerrecreating manually-deleted organization affiliations. The worker rebuilds each member's org affiliation timeline from scratch on every run, but its "current state" read filtered out soft-deletedmemberOrganizationsrows entirely — so a manually-deleted affiliation was indistinguishable from one that never existed, and the enrichment provider (PDL/Clearbit/etc.) kept resupplying and recreating it. Reported in DE-1016/DE-1021 (Dusky'z contributions incorrectly reappearing on OpenDaylight, instead of being merged into PANTHEON.tech).Changes
fetchMemberDataForLLMSquashing(services/libs/data-access-layer/.../members_enrichment_worker/index.ts) now also returnsdeletedOrganizations: distinctorganizationIds with a soft-deleted, non-UI/PROJECT_REGISTRY-sourcedmemberOrganizationsrow for the member — these act as tombstones.prepareWorkExperiences(services/apps/members_enrichment_worker/src/activities/enrichment.ts) now takes the tombstone set and filters them out of the incoming enrichment payload before deciding what to create, so a manually-deleted affiliation is never recreated.IDeletedMemberOrganizationDatato@crowd/types, exposed asdeletedOrganizationsonIMemberOriginalData.Type of change