fix: drop invalid Crustdata business emails and retry enrich - #4536
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Contributor
There was a problem hiding this comment.
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
nullwhen 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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Crustdata returns HTTP 400 and rejects the whole
/person/enrichrequest when anybusiness_emailsvalue is not a valid business identifier (for example a government-domain address). That failed TemporalenrichMemberfor members with no LinkedIn and only those emails, even though other enrichment sources could still succeed.Changes
getDataUsingWorkEmails, catch only400+invalid_request+Invalid business emails: ….nullwhen nothing is left so the workflow caches a miss and continues. All other 400s still throw.