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

[Hosts] Duplicate check improvement #32805

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidegiacometti
Copy link
Collaborator

Summary of the Pull Request

The duplicate check logic degraded overtime with the additional logics introduced (max 9 hosts per line, etc..).

  • This PR aims to move the current logic from the view model to a dedicated service and make it async.
  • Since a typical usage of the hosts file is to block domains mapping them to 0.0.0.0 I have added 0.0.0.0 (and IPv6 equivalent) to the list of loopback addresses in order to skip the check.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

  • Manually tested with a hosts file containing more than 100K entries:
    • Verified that duplicate check is working as before but in an async way
    • Tested file reload
    • Tested "Consider loopback addresses as duplicate" enable/disable (it does trigger a hosts file reload)
    • Edited an entry with a huge number of duplicates and verified that UI doesn't freeze

{
"0.0.0.0",
"::0",
"0:0:0:0:0:0:0:0",

This comment was marked as outdated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants