Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

"Show the number of blocked resources on the icon" may be temporarily forced to default when restoring session #75

Open
5 of 9 tasks
ssokolow opened this issue Oct 18, 2018 · 10 comments
Labels
bug Something isn't working external an external factor is involved unable to reproduce cannot reproduce the given issue

Comments

@ssokolow
Copy link

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
  • This is not a support issue or a question
    • Support issues and questions are handled at /r/uMatrix
  • I tried to reproduce the issue when...
    • uMatrix is the only extension
    • uMatrix with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uMatrix
  • I checked the documentation to understand that the issue I report is not a normal behavior
  • I used the logger to rule out that the issue is caused by my ruleset

Given that it happens as part of session restore, I couldn't figure out a way that it would be possible to bring the logger into play... even if rulesets were able to control this particular aspect of the UI.

Given the nature of the problem, which I suspect to be a race condition, I'm going to need to block out some serious time to test under the reduced conditions (uMatrix only, default lists/settings, new browser profile), since I don't yet have a standard practice for quickly building a fresh browser profile that's intentionally bogged down and I wanted to know whether what I've submitted is enough before I potentially spend needless time on it.

Description

Sometimes, when I restart my Firefox, uMatrix displays the active tab's browser action with the blocked resource count visible, despite the "Show the number of blocked resources on the icon" checkbox being unchecked.

The browser action for any tab loaded or reloaded after the session restore finishes (including reloading the same tab) will obey the user preferences as expected, so I suspect this is some kind of race where it's falling back to default settings because loading the user preferences was delayed.

A specific URL where the issue occurs

This time, the tab which was active after I restarted the browser was pointed at piroor/treestyletab#2006 (comment)

Steps to Reproduce

  1. Check "Restore previous session" in Firefox
  2. Uncheck "Show the number of blocked resources on the icon" in uMatrix
  3. Open a page which has blocked resources
  4. Open up enough stuff to bog down the session restore process (My session contains 443 tabs across four windows on three monitors, plus three dozen browser extensions, running on an Athlon II X2 270 (dual-core) CPU with no SSD and my Firefox starts up as part of a flurry of on-login tasks that bog the desktop down for over a minute as they contend for resources.)
  5. Restart the browser

Supporting evidence

screenshot20

screenshot21

Your environment

  • uMatrix version: 1.3.14
  • Browser Name and version: Firefox Developer Edition 64.0b1 (64-bit)
  • Operating System and version: Kubuntu 14.04.5 LTS (64-bit)
@uBlock-user
Copy link
Contributor

uBlock-user commented Oct 18, 2018

My session contains 443 tabs across four windows on three monitors, plus three dozen browser extensions, running on an Athlon II X2 270 (dual-core) CPU with no SSD and my Firefox starts up as part of a flurry of on-login tasks that bog the desktop down for over a minute as they contend for resources.

That's not possible for me to recreate. Is that a specific requirement ?

Aside from that, I cannot reproduce. Most likely a race condition due to Restore previous session settings which forces to restore immediately upon startup.

@uBlock-user uBlock-user added the Firefox specific to Firefox label Oct 18, 2018
@ssokolow
Copy link
Author

That's not possible for me to recreate. Is that a specific requirement ?

Just a parenthesized clarification on the situation where the problem has been observed outside test conditions. I'll see if I can find time to produce something more reliable later.

(One idea I have is to try with a warm filesystem cache and then clear out the drive and OS read caches before running the test in order to see if that alters the chances of a successful reproduction.)

Aside from that, I cannot reproduce. Most likely a race condition due to Restore previous session settings which forces to restore immediately upon startup.

That was my hypothesis too, given the symptoms.

@uBlock-user uBlock-user added unable to reproduce cannot reproduce the given issue and removed Firefox specific to Firefox labels Oct 18, 2018
@uBlock-user
Copy link
Contributor

I tested with 5 tabs of blogs with heavy content blockage on both Chromium and Firefox, the setting sticks, still cannot reproduce.

@gorhill
Copy link
Member

gorhill commented Oct 18, 2018

Most likely a race condition due to Restore previous session settings which forces to restore immediately upon startup.

Yes. uMatrix is not guaranteed to be fully ready when the browser loads the tabs, and given in the current case there are hundreds of tabs, tens of extensions (of which uMatrix is just one of them), uMatrix probably finishes loading user settings after the tabs finished loading.

You can actually reproduce with a simpler scenario: open uMatrix's dashboard in a separate window, have a tab with blocked stuff in the original window (such that there is a badge for it displayed), and toggle the setting "Show the number of blocked requests on the icon": the badge is not toggled unless it needs to be re-rendered.

It's really a very transient "glitch" though, just switching tab or whenever the tab is reloaded, the issue disappear. I consider this a bottom-of-the-list issue given that: difficult to reproduce + only cosmetic + very transient.

@uBlock-user uBlock-user added bug Something isn't working external an external factor is involved unable to reproduce cannot reproduce the given issue and removed unable to reproduce cannot reproduce the given issue labels Oct 18, 2018
@ssokolow
Copy link
Author

I'm guessing this is another facet of the ongoing problem of WebExtensions not yet providing a way for early tab loading to block on extensions being ready to filter the requests?

(Because, otherwise, I'd wonder why you're not storing all the settings in whatever datastore is currently used for user rulesets.)

@uBlock-user
Copy link
Contributor

The race condition is an issue which hasn't been addressed as expected.

@gorhill
Copy link
Member

gorhill commented Oct 19, 2018

I'd wonder why you're not storing all the settings in whatever datastore is currently used for user rulesets.

You are assuming wrong, they are saved in the same datastore.

@ssokolow
Copy link
Author

You are assuming wrong, they are saved in the same datastore.

I wasn't assuming anything. I wrote that as an "otherwise" case after saying something that boils down to "I'm guessing this is another symptom of WebExtensions not giving uMatrix sufficient power to ensure proper ordering of operations?".

@gorhill
Copy link
Member

gorhill commented Oct 19, 2018

Note that whenever I fix #69 the current issue could go away as well.

@ssokolow
Copy link
Author

Hopefully.

Either way, I'm in no rush. I just wanted it to be "on file".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working external an external factor is involved unable to reproduce cannot reproduce the given issue
Projects
None yet
Development

No branches or pull requests

3 participants