Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Scrubber #2471

Merged
merged 5 commits into from
Oct 1, 2024
Merged

Fix Scrubber #2471

merged 5 commits into from
Oct 1, 2024

Conversation

engelhartrueben
Copy link
Collaborator

Fixes # (issue)

Scrubbing numbers with Twilio

Description

Upgraded Twilio Lookup to V2. Twilio Documentation

// From V1
phoneNumber:  {
  callingCountryCode: '1',
  countryCode: 'US',
  phoneNumber: '+~~~~~~~~~~~',
  nationalFormat: '~~~~~~~~~~~',
  valid: true,
  validationErrors: [],
  callerName: null,
  simSwap: null,
  callForwarding: null,
  lineStatus: null,
  lineTypeIntelligence: null,
  identityMatch: null,
  reassignedNumber: null,
  smsPumpingRisk: null,
  phoneNumberQualityScore: null,
  url: 'https://lookups.twilio.com/v2/PhoneNumbers/+~~~~~~~~~'
}

// To V2
phoneNumber:  {
  callingCountryCode: '1',
  countryCode: 'US',
  phoneNumber: '~~~~~~~~~~',
  nationalFormat: '~~~~~~~~~~',
  valid: true,
  validationErrors: [],
  callerName: null,
  simSwap: null,
  callForwarding: null,
  lineStatus: null,
  lineTypeIntelligence: {
    carrier_name: 'Verizon Wireless',
    error_code: null,
    mobile_country_code: '310',
    mobile_network_code: '010',
    type: 'mobile'
  },
  identityMatch: null,
  reassignedNumber: null,
  smsPumpingRisk: null,
  phoneNumberQualityScore: null,
  url: 'https://lookups.twilio.com/v2/PhoneNumbers/~~~~~~~~~~~'
}

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change, and any blockers that make your change a WIP

Checklist:

  • I have manually tested my changes on desktop and mobile (and staging)
  • The test suite passes locally with my changes
  • If my change is a UI change, I have attached a screenshot to the description section of this pull request
  • My change is 300 lines of code or less, or has a documented reason in the description why it’s longer
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • My PR is labeled [WIP] if it is in progress

if (lookupName) {
// caller-name is more expensive
types.push("caller-name");
types.fields = ("line_type_intelligence,caller-name");
Copy link
Member

Choose a reason for hiding this comment

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

should this be an array instead of parentheses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oddly enough, no: https://www.twilio.com/docs/lookup/v2-api#code-lookup-with-data-packages
Twilio wants types.fields as a comma separated string. That parentheses is awkward though

@@ -306,6 +306,7 @@ export async function nextBatchJobLookups({
lastCount,
steps
);
console.log("scrub-bad-mobilenums error: ", err);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

log.error

@engelhartrueben
Copy link
Collaborator Author

@mau11 the changes we talked about are in.

Copy link
Member

@mau11 mau11 left a comment

Choose a reason for hiding this comment

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

🎉

@engelhartrueben engelhartrueben merged commit 2b8c7c5 into stage-main-14.1.1 Oct 1, 2024
17 checks passed
@engelhartrueben engelhartrueben deleted the re/twilio-lookup branch October 1, 2024 18:37
@mau11 mau11 mentioned this pull request Oct 1, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 14.1.1
Development

Successfully merging this pull request may close these issues.

2 participants