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

Introduce obfuscate module with tests #266

Merged
merged 2 commits into from Feb 9, 2022
Merged

Introduce obfuscate module with tests #266

merged 2 commits into from Feb 9, 2022

Conversation

gauntface
Copy link
Collaborator

I hit an issue when running this locally and narrowed it down to the obfuscate method.

One additional layer here is to add a rescue exception clause which it looks like is being done in production, but it's unclear if that's necessary with this approach, but given the nature of this tool, it might be the best option to keep on going.

Copy link
Owner

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

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

👍

crawler/crawler.rb Outdated Show resolved Hide resolved
crawler/crawler.rb Outdated Show resolved Hide resolved

h.each_value do |v|
self.email(v) if v.is_a? Hash
v.each {|e| self.email(e)} if v.is_a? Array
Copy link
Owner

Choose a reason for hiding this comment

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

There is an unhandled edge case here that recently took down the crawler. I believe the issue was that we had an array of strings and that crashed this function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I believe this is captured in the test - see test_no_obfuscation_for_other_fields which has an "array-string" value.

This bubbled up in local testing and was before I found the fix in prod.

@gauntface
Copy link
Collaborator Author

Sorry I think I gave you a bunch of debug code in this PR. Will tidy up ASAP.

Copy link
Owner

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

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

👍🏻 nice work!

@gauntface gauntface merged commit d29797a into igrigorik:master Feb 9, 2022
@gauntface gauntface deleted the obfuscate branch February 9, 2022 18:38
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.

None yet

2 participants