You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: don't treat placeholder employers as organizations - #5168
Generic employer labels like "Freelance", "Self-employed", "Student" or "N/A" were resolved as organizations. They either created placeholder orgs or matched real companies by name (Freelancer Technology Pty Ltd, National Student Clearinghouse, Student Inc). This PR stops treating them as organizations. Enrichment records those roles at Individual - No Account instead.
Changes
Added isPlaceholderEmployerName to @crowd/common. It matches a fixed set of labels, ignoring case, spacing and punctuation. Digits and non-ASCII letters are kept, so Student42 doesn't match. Real names that only contain a label (Freelancer.com, Ace Freelance, Student Inc) don't match.
findOrCreateOrganization returns undefined for a placeholder name, before any lookup. This covers data sink for all integrations, enrichment and the public API. Every caller already handles undefined.
Enrichment maps placeholder roles to Individual - No Account, with no identities attached.
GitHub skips the GitHub org lookup when the profile company is a placeholder. Otherwise @freelancer resolves to the Freelancer Technology GitHub org, whose name isn't a placeholder.
POST /organizations rejects placeholder names with a 400.
The new exports in @crowd/common are additive. Existing rows pointing at placeholder or wrong orgs will be fixed separately.
skwowet
changed the title
fix: stop resolving placeholder employer labels to organizations
fix: don't treat placeholder employers as organizations
Nov 2, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The data-sink cache can bypass placeholder safeguards and incorrectly attach members or skip real employers, while normalization also rejects legitimate names containing digits.
This PR prevents generic employer labels from resolving to organizations across CDP ingestion, enrichment, and the public API. Enrichment instead associates these roles with Individual - No Account.
Changes:
Adds shared placeholder-name detection and guards organization resolution and creation.
Maps placeholder enrichment roles to the fallback organization without triggering organization-wide member re-indexing.
Skips GitHub organization lookups for placeholder company names and documents the behavior.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Identity-only caching makes placeholder handling order-dependent, causing lost or incorrect affiliations, while overbroad normalization incorrectly rejects distinct organization names.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A missing or ambiguous fallback account silently drops placeholder roles, allowing reconciliation to delete existing enrichment work history without replacement instead of aborting the transaction.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Abort when the fallback account is missing or ambiguous
If Individual - No Account is missing or has multiple active matches, this branch silently drops the placeholder roles. Reconciliation still runs and can delete existing enrichment work history without recording a replacement. Abort the transaction when the fallback cannot be resolved rather than treating a failed lookup as empty employment history.
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
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
Generic employer labels like "Freelance", "Self-employed", "Student" or "N/A" were resolved as organizations. They either created placeholder orgs or matched real companies by name (Freelancer Technology Pty Ltd, National Student Clearinghouse, Student Inc). This PR stops treating them as organizations. Enrichment records those roles at
Individual - No Accountinstead.Changes
isPlaceholderEmployerNameto@crowd/common. It matches a fixed set of labels, ignoring case, spacing and punctuation. Digits and non-ASCII letters are kept, soStudent42doesn't match. Real names that only contain a label (Freelancer.com, Ace Freelance, Student Inc) don't match.findOrCreateOrganizationreturnsundefinedfor a placeholder name, before any lookup. This covers data sink for all integrations, enrichment and the public API. Every caller already handlesundefined.Individual - No Account, with no identities attached.@freelancerresolves to the Freelancer Technology GitHub org, whose name isn't a placeholder.POST /organizationsrejects placeholder names with a 400.The new exports in
@crowd/commonare additive. Existing rows pointing at placeholder or wrong orgs will be fixed separately.Type of change
Related issue
Refs linuxfoundation/lfx-cdp-insights-ops#908