Skip to content

fix: drop invalid Crustdata business emails and retry enrich - #4536

Merged
skwowet merged 2 commits into
mainfrom
fix/crustdata-invalid-business-emails
Aug 31, 2026
Merged

fix: drop invalid Crustdata business emails and retry enrich#4536
skwowet merged 2 commits into
mainfrom
fix/crustdata-invalid-business-emails

Conversation

@skwowet

@skwowet skwowet commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Crustdata returns HTTP 400 and rejects the whole /person/enrich request when any business_emails value is not a valid business identifier (for example a government-domain address). That failed Temporal enrichMember for members with no LinkedIn and only those emails, even though other enrichment sources could still succeed.

Changes

  • In getDataUsingWorkEmails, catch only 400 + invalid_request + Invalid business emails: ….
  • Parse the comma-separated invalid list from the error message, drop those emails, and retry with whatever remains.
  • Return null when nothing is left so the workflow caches a miss and continues. All other 400s still throw.

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 31, 2026 16:04
@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

Handles Crustdata invalid-business-email responses while allowing enrichment to continue.

Changes:

  • Parses rejected emails from specific 400 responses.
  • Retries with valid remaining emails.
  • Returns null when none remain.
Suppressed comments (1)

services/apps/members_enrichment_worker/src/sources/crustdata/service.ts:297

  • This comment only restates the immediately following split/filter operation, contrary to the repository's no-narrative-comments convention. The code is self-explanatory without it.
        // The API returns all invalid emails as a comma-separated list in the error message.
        // Exclude them so valid emails can still be enriched on the next attempt.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@skwowet
skwowet merged commit 9bf7a0c into main Aug 31, 2026
14 checks passed
@skwowet
skwowet deleted the fix/crustdata-invalid-business-emails branch August 31, 2026 16:36
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