Skip to content

use same lookup for mx-servers #286

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

Merged
merged 11 commits into from
Feb 26, 2025
Merged

use same lookup for mx-servers #286

merged 11 commits into from
Feb 26, 2025

Conversation

phoet
Copy link
Collaborator

@phoet phoet commented Feb 26, 2025

this is built on the changes from #283 but instead of caching the result, we use the same lookup as with the regular disposable list. this results in a lookup from a set instead of iterating over the domains. this should be much faster overall and also removes the necessicty to do any caching.

@phoet phoet changed the title Sensortower cache mx servers in use same lookup for mx-servers Feb 26, 2025
Copy link
Contributor

@jurajjuricic-st jurajjuricic-st left a comment

Choose a reason for hiding this comment

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

Thanks, this works great!

@phoet phoet merged commit 9f0d7e2 into main Feb 26, 2025
16 checks passed
@phoet phoet deleted the sensortower-cache-mx-servers-in branch February 26, 2025 15:13
@nijikon
Copy link

nijikon commented Mar 1, 2025

@phoet In this PR, you replaced mx_server_is_in? with disposable_mx_server?. Adding a note about this in the CHANGELOG would be a good idea, as the testing stub needs to be adjusted. https://github.com/micke/valid_email2?tab=readme-ov-file#test-environment

What do you think?

@phoet
Copy link
Collaborator Author

phoet commented Mar 1, 2025

@nijikon i'm a new contributor and my knowledge does not strech the whole project yet. did you run into any trouble with the change? is there something we need to take care of that needs fixing?

i'm about to propse a change where all testing stubs can be replaced by an injected dns test stub. i found the current stubbing to be extremely cluttered and inconvenient to work with. i will definitively add a note to the changelog for that.

@nijikon
Copy link

nijikon commented Mar 1, 2025

Currently, if you use 7.0.11 along with the suggested stub from the documentation, you will encounter this error.

Failure/Error: allow_any_instance_of(ValidEmail2::Address).to receive_messages(valid_mx?: true, valid_strict_mx?: true, mx_server_is_in?: false)
          ValidEmail2::Address does not implement #mx_server_is_in?

@phoet
Copy link
Collaborator Author

phoet commented Mar 1, 2025

@nijikon 7.0.12 should be there

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.

5 participants