Open Bug 1615885 Opened 4 years ago Updated 2 years ago

[WebExtensions API] Fake events in idle.onStateChanged()

Categories

(Core :: Widget: Win32, defect, P2)

74 Branch
Desktop
Windows
defect

Tracking

()

Tracking Status
firefox73 --- affected
firefox74 --- affected
firefox75 --- affected

People

(Reporter: klestofer, Unassigned)

Details

(Keywords: parity-chrome, testcase)

Attachments

(1 file)

42.30 KB, application/x-zip-compressed
Details
Attached file extension & screen

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

  1. Install attached extension.
  2. Inspect it and open Console tab.
  3. Wait for at least a minute WITHOUT TOUCHING KEYBOARD AND MOUSE.

Actual results:

After 15 seconds 'idle' event will happen and although no keyboard and mouse are touched, Firefox will soon report some fake events!

Expected results:

After 15 seconds 'idle' event will happen and no new events should happen until you touch keyboard or mouse.

Bug happens not every time. On attached screen, I’ve run extension in Chrome and in Firefox. First event at 22:09:45 correctly reported in both browsers. Last event at 22:11:32 is when I finally moved mouse. It is also correctly reported in both browsers. But between these events I did not touch mouse and keyboard, but for some reason Firefox decided that I did it 3 times.

Has STR: --- → yes
Component: Untriaged → General
Product: Firefox → WebExtensions
Flags: needinfo?(tomica)

I reproduced this on Windows 10 in Nightly 75, and confirmed Chrome doesn't have this false "active" events, which is weird since we should be using the same underlying OS-level idle information as them.

Furthermore, it seems that most fictive "active" events happen exactly 5 (or 5*N) seconds after the last "idle" event, and are often followed by another "idle" event milliseconds later, which points to a bug in our implementation:

https://searchfox.org/mozilla-central/rev/5a10be60/widget/nsIdleService.cpp#30

Miruna, can we please get this confirmed on other platforms, along with comparison results from Chrome as well?

Flags: needinfo?(tomica) → needinfo?(mcurtean)

Sure.
I've tried reproducing this on Ubuntu 18.04 LTS and MacOS Catalina 10.15 on Firefox 74 and 75 against Chrome but even minutes after the 'idle.onStateChanged() idle' event is logged no others follow it, only the expected 'idle.onStateChanged() active' one when idle activity is interrupted through using either the keyboard or the mouse. This applies to both Firefox and Chrome browsers and after removing and reloading the extension multiple times.
On Windows pro 10 x64 I've managed to consistently reproduce this as well on FF 73.0.1 (20200217142647), 74.0b6 (20200221001238) and 75.0a1 (20200221095110). Multiple idle and active events are logged in the extension's console even though the keyboard and mouse are not touched, although I can't say I noticed a particular frequency.
I've updated the platform and status of the bug accordingly.
Let me know if there anything else I can help with.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mcurtean)
OS: Unspecified → Windows
Hardware: Unspecified → Desktop

Looks like a windows specific bug with the idle service, passing over to the widget component.

Component: General → Widget: Win32
Product: WebExtensions → Core

The priority flag is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Priority: -- → P2
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: