AdguardTeam / AdguardForiOS

The most advanced ad blocker for iOS
https://adguard.com/
GNU General Public License v3.0
1.43k stars 202 forks source link

DNS filterlists are updated on the disk without reloading DNS filtering which causes random filtering issues #1732

Closed ameshkov closed 2 years ago

ameshkov commented 3 years ago

Here's the problem:

  1. DNSProxy indexes DNS filterlists files and loads full rule texts in a lazy manner
  2. When you update the DNS filterlist file AND do not reload DNS filtering, it uses the old index to access the NEW file. This causes random issues - for instance, it will read just a part of the rule com^ instead of ||example.com^.

Probably, this is done during background fetch.

This is rather easy to reproduce:

  1. Subscribe to a custom blocklist with the only rule:
    ! this is comment
    ||example.com^
  2. Change that blocklist to:
    ! this
    ||example.com^
  3. Wait for the background fetch to happen, the filterlist will be updated on the disk
  4. It will start blocking all .com domains because the old index points to .com^
sfionov commented 3 years ago

From support chat: image

ghost commented 2 years ago

I'm experiencing this issue!

Was noticing random things being blocked in local filtering and wasn't understanding why.

Anything I can do in the meantime?

@ameshkov @IvanIin

image

ameshkov commented 2 years ago

@planet0 next update should resolve it for good.

ghost commented 2 years ago

@ameshkov Would turning off background app refresh for AdGuard help with this issue in the meantime?

ameshkov commented 2 years ago

@planet0 yep, it will help