el1t / uBlock-Safari

uBlock Origin - An efficient blocker for Chromium, Firefox, and Safari. Fast and lean.
GNU General Public License v3.0
2.74k stars 97 forks source link

Filter auto update not working (?) #25

Closed maciboy closed 7 years ago

maciboy commented 7 years ago

Hey,

honestly I’m not sure if this is a real issue/bug, but I observed a strange behavior on my side:

uBlock does not „auto-update“ its filter lists regularly. Every time, when I go into the uBlock settings, the update button is orange, meaning that updates are available. (The option the auto-update on top of the filters page is activated…)

Before, I used uBlock origin and there the update-button was not orange every single time when looking into the settings, only sometimes… However, now with uBlock it only seems to work with manual refreshes.

This behavior at least occurred with v1.10.5b9 and now with 1.10.7b. Don’t know if it worked before.

I’m using uBlock with Safari 10.0.3 and macOS 10.12.3.

If you have any idea how to test if auto-update is working other than just look into the filter-settings, please let me know :)

Nevertheless, thank you so much @el1t for bringing this addon back to live for Safari, it’s awesome!

These are my filters, if this helps: bildschirmfoto 2017-02-04 um 16 18 21 bildschirmfoto 2017-02-04 um 16 18 52 bildschirmfoto 2017-02-04 um 16 19 06

gorhill commented 7 years ago

If you have any idea how to test if auto-update is working other than just look into the filter-settings, please let me know :)

maciboy commented 7 years ago

Will do that and post the result! Thanks for the very quick answer!

maciboy commented 7 years ago

So, after some testing, I honestly believe there is something broken, at least on my system :/

As @gorhill recommended, I deleted the cache for one specific page and closed Safari. After running Safari for at least 45 mins, I opened the uB-settings and found several lists saying „out of date“ (the deleted cache-list was among them) I became suspicious and clicked on the „I don’t care about cookies“ filter: it says that it was updated the last time on 28.12.16. Same with EasyList: ! Last modified: 24 Dec 2016 11:33 UTC

There can’t be any updates for these lists…

So what I did was resetting Safari by deleting history and website data. After I did this, I went into Library/Caches and deleted the whole com.apple.Safari folder.

After opening Safari again and looking into the uB-settings, of course all the filters were outdated, since their cache was deleted, too… So I updates them all. I closed Safari. Reopened Safari, looking into uB-settings: All filters out of data… Did this several times, all filters are out of date after restarting Safari.

uB 1.10.7.103 How can I help to identify the issue?

gorhill commented 7 years ago

Is there a dev console for extensions with Safari? If so, you could look at uBO's console to find out if there are errors reported.

el1t commented 7 years ago

Yeah, there's a way to inspect the global page from the Safari Extension Builder. I'm not familiar with the auto-update code (yet) but I'll look into it soon.

el1t commented 7 years ago

It seems like auto-updating works. However, bundled lists (uAssets/filters and uAssets/thirdparties) are not updating at all, even though other lists do. It's only apparent after restarting Safari because a manual update removes the outdated warnings without actually updating them.

gorhill commented 7 years ago

If this helps, this is the line where an asset is pulled from its remote location and cached if it succeed: https://github.com/el1t/uBlock-Safari/blob/safari/src/js/assets.js#L990.

This is true for both manual and auto-update.

Hackl0us commented 7 years ago

I have the same problem after installing the latest version.

Every time, I reopen the Safari browser click the "Filter" tab in uBlock Dashboard. It always shows some filters need to be updated.

I tried to purge all caches, and finally reinstalled the uBlock extension, it still didn't work.

It seems the filters didn't update at all.

Anyway, thanks to @el1t. You're really really awesome, make uBlock work on Safari again. I'll wait for the next version.

Have a nice day 😄

el1t commented 7 years ago

Found the problem, was completely unrelated to fetching resources 😅However, while I was searching, I noticed that assetAutoUpdatePeriod was listed as autoUpdatePeriod in hiddenSettingsDefault, which probably doesn't work.

maciboy commented 7 years ago

That sounds great, what a quick fix & reaction!

I will test again, when the next release is available, but sounds as if it got fixed…

Thank you so much for making the web great again ;D

MysticalOS commented 7 years ago

Is this what was causing the hang on launch with cfprefs process using 100% cpu since last update? Ever since last release safari launches been hanging for a few seconds while cfprefs tries to make out settings for "something". I had a hunch it could be ublock

maciboy commented 7 years ago

mmh, I’m experiencing this initial hang as well! Thought that it has to do with my update to macOS 10.12.3, but now it makes sense that it has to do with uBlock. It also cfprefsd.

MysticalOS commented 7 years ago

Well, i didn't have hang start until most recent u block. but i've had 10.12.3 for days longer. I could be mistaken though and just didn't bug out until recently and it's pure coincidence but figured I'd mention just incase

maciboy commented 7 years ago

Nope I think you are right, this hang happens since installing uB 1.10.7, I’m running 10.12.3 also for longer and had not recognized that behavior before.

Also I updated all the filters and then closed Safari to generate the hang. While starting up, I investigated what cfprefsd was doing with „sudo fs_usage

Here is the result: Some Safari-Extensions are writing massive about of data. It think we don’t have to guess, which one that is ;) What is shown in the screenshot is only a small percentage of the outputs.…

However, maybe this got fixed as well. Could you please provide a new release @el1t so that we can test it for you.

bildschirmfoto 2017-02-06 um 19 19 16

el1t commented 7 years ago

Updated to 1.11.1b0, please let me know if it's fixed for you (and open a new issue if the hang exists without the auto-update issue).

maciboy commented 7 years ago

At the first glimpse it looks very good, no updates available after resetting cache, updating and a Safari restart :)

Thanks!

Hackl0us commented 7 years ago

Seems that it works very well.

I downloaded and installed the latest version just now. I purged all caches and re-download all filters and rules. I relaunched the Safari, filters were still there. No updates available. I guess problem solved.

Really nice work @el1t Thank you so much (づ ̄3 ̄)づ╭❤

bryandmlee commented 7 years ago

I just updated to 1.11.1b as well. I purged all caches, and left the auto-update to do its thing. The filters seem to have been auto-updated after a short period of time, and appear to persist through a Safari relaunch and even macOS restart—as observed by other users too.

However, the "Storage used:" in the main Settings tab still shows "0 bytes" after all the filter updating. (I do recall 1.10.7b reflecting the "Storage used:" values properly.)

uBlock-Safari 1.11.1b, default settings; Safari 10.0.3; macOS 10.12.3;

MysticalOS commented 7 years ago

I haven't gotten any hangs on safari since 1.11.1b

el1t commented 7 years ago

Thanks everyone! @bryandmlee Oops, I actually meant to remove the Storage used calculation because it's slow and blocking (no quick way to get that stat). I'll do that and close this issue.