AdguardTeam / AdguardForiOS

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

Advanced protection sporadicaly stops working entirely #2204

Open Morku opened 1 year ago

Morku commented 1 year ago

Issue Details

The Advanced Protection sporadicly stops working for unknown reason. The Safari content filters are unaffected. They continue working properly. There is no way to reproduce it. It simply stops at some time. Sometimes after 2-3 weeks, sometimes 1-2 times within a week. It might have to do with/after network changes or filtering update. Thats why I struggle over month to fill the Bug report, because it can take weeks/month to report back if try something.

When the issue starts to happen, the App still act like that Advanced Protection is still enabled and even the advanced option shows the amount of active filters.

To solve the issue I have tried:

And this is the only solution I found to fix the issue:

until it occurs again after Days/Weeks/Months

Video

Here are two example pages where Advanced protection usually works fine: https://www.sueddeutsche.de/politik/ukraine-binnenfluechtlinge-reportage-krieg-russland-1.6126900?reduced=true

https://www.videohelp.com/software?updated=List+all+by+latest+version

Both filters are CSS extended filters #?# that are handled by Advanced Protection. On Sueddeutsche there is that "-Anazeige-" Ad placeholder. On videohelp there is that "Try StreamFab" Adline. Both shouldn't be displayed with AdGuard filters. But also other filters, like Cookie autoclicker #%# are affected.

Video: https://github.com/AdguardTeam/AdguardForiOS/assets/6276915/cc3983b9-7ed1-4d1c-baa1-c32a11891d98

Additional Information

I have made a Debug Logfile ater I got back the issue and browsed both pages. Tell me, if needed.

Versty commented 1 year ago

@Morku Thank you for reporting! Have you noticed this problem in versions prior to 4.5?

The logs from you device would be much appreciated. Please send it to apple@adguard.com and mention the number 2204 in the subject line.

Morku commented 1 year ago

@Versty I have send you the logfile at the moment, the issue occur.

Yes, I noticed the issue already prior 4.5, but was never confident enough where and when the issue happen and did not open a ticket in hope that "it doesn't happen again". At the moment, everything is back fine, after the Advanced protection recovered again by waiting 2 Days.

Versty commented 1 year ago

@Morku Thank you, we have received your logs and have delivered the archive to the developers for further investigation. We will keep you updated if there is any news.

Morku commented 1 year ago

Today the issue recovered. Yes, it took that long (about 1 month). Again for no obvious reason. No filter of Advanced protection is working (most likely noticable with several Cookie Pop-ups), but content filters works fine. Updating filters, restart Safari does not fix the issue (see list above). AdGuard is not showing any error or reason why it shouldn't work (Advanced protection is showing 22046 active rules). I have sent another logfile.

Versty commented 1 year ago

@Morku Could you recall the time when you noticed that the Advanced rules were not working?

Morku commented 1 year ago

@Versty About ~30 minutes or more before I created the second logfile. So maybe 14th September 11:00am (+- 30 minutes). When I noticed I enabled Debug Logs again and browsed 2-3 more pages to check if there is still the issue. Then I created the logfile.

On the next day, 15th September, everything started working fine again.

Versty commented 1 year ago

@Morku Has this error was present prior to the problem occurring?

Morku commented 1 year ago

@Versty No, I have never seen this error before. Not in iOS 16 and not in iOS 17.

I sometimes have the "updating filters failed" error, but it's unrelated to the issue, that Advanced protection stops working.

Versty commented 1 year ago

@Morku Thank you for the provided information. We are investigating.

Morku commented 11 months ago

@Versty

Hi, I want to tell that the issue still persist with iOS 17.2 and AdGuard for iOS 4.5.2.

It looks like the issue happens when:

However, one thing seems improved since iOS 17.0 -> not all Advanced Protection rules are affected anymore. Cookie Pop-ups (scriptlet) do work always fine now. Might be luck(?)

When the issue recover, I notice for two pages:

https://www.videohelp.com/software?updated=List+all+by+latest+version

Screenshot-1: ![IMG_724699475271](https://github.com/AdguardTeam/AdguardForiOS/assets/6276915/42db6ac3-1c3d-4256-a872-18ef33f0df7a)

This text Ad is handled by: `videohelp.com#?#div[id] a[href]:contains(/^Try (?:D.?V.?D.?F.?a.?b.?|StreamFab)|^StreamFab|^DVDFab$/) + a[href]:upward(1)` https://www.sueddeutsche.de/wirtschaft/bahn-streik-gdl-januar-1.6321748?reduced=true
Screenshot-2: ![IMG_724699648624](https://github.com/AdguardTeam/AdguardForiOS/assets/6276915/2dbcb677-af64-4cae-9d28-cff34d21b51a)

This placeholder is handled by: `sueddeutsche.de#?#article > div[data-manual-remove="true"]:has(> div[id^="iqadt"])` It is noticable that rules with `#?#` are affected. It is still uncontrollable when my phone decide to recover the Extension. Sometimes hours, sometimes a Day ... It is odd. I hope the Info helps.
Versty commented 10 months ago

@Morku Thank you for additional details. This issue will be fixed with a complete code rework in one of the next major updates.