Open
Bug 1383244
Opened 7 years ago
Updated 2 years ago
Idle timeout doesn't always happen as expected with the `idle` api
Categories
(WebExtensions :: General, defect, P5)
Tracking
(Not tracked)
NEW
People
(Reporter: pmorris, Unassigned)
Details
The idle timeout with the idle api[0] doesn't always work as expected. I'm working on porting "Mind the Time"[1] to WebExtensions and have uploaded some beta releases. Sometimes I'll leave my laptop sitting for awhile with a tab/window activated/focused. Usually the idle timeout will happen and the right amount of time will be logged for the current domain, but sometimes the idle timeout does not happen and way too much time is logged. This is on FF 55.0 dev edition, multi-process, on Ubuntu 16.04, with my own profile with many open tabs, other add-ons, and several windows open. I've added console logging to the beta version of Mind the Time to explore the issue and it shows that the idle timeout does not always fire when I expect it to. This leads to a regression in my addon's functionality that's blocking its migration to WebExtensions. [0] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/idle [1] https://addons.mozilla.org/en-US/firefox/addon/mind-the-time/
Updated•7 years ago
|
Flags: needinfo?(amckay)
Comment 1•7 years ago
|
||
This sounds similar to bug 1359403, although that talks about alarms and suspension but not sure if its a duplicate. See also bug 1377744.
Flags: needinfo?(amckay)
Priority: -- → P5
Reporter | ||
Comment 2•7 years ago
|
||
I don't think this is a duplicate of either of those other bugs. This one involves the `idle` api and AFAICT the others don't. This bug is tricky because mostly the idle timeout works, but when it doesn't it makes the time logged by my add-on incorrect, sometimes making it off by many hours. And that messes up its primary functionality.
Reporter | ||
Comment 3•7 years ago
|
||
I made a simple add-on to help with detecting/reproducing the issue: https://addons.mozilla.org/en-US/firefox/addon/idle-api-tester/
Comment 4•7 years ago
|
||
Paul, sorry for the slow reply but can you narrow this down a bit? Did the non-webextension version of Mind the Time use nsIIdleService? And are the quirks you're seeing unique to webextensions? (ie, did you see similar things when using nsIIdleService directly?)
Flags: needinfo?(paul)
Reporter | ||
Comment 5•7 years ago
|
||
Sure thing. Before webextensions Mind the Time was built with the add-on sdk, and used the sdk's lower level apis for idle timeout functionality. Below is the code that uses "sdk/system/events" and "user-interaction-active". I've only seen these quirks after converting to webextensions, not with the previous sdk version of the add-on. let systemEvents = require("sdk/system/events"); exports.addActivityListener = function(callback) { systemEvents.on("user-interaction-active", callback); }; exports.removeActivityListener = function(callback) { systemEvents.off("user-interaction-active", callback); };
Flags: needinfo?(paul)
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Comment 6•6 years ago
|
||
Bulk move of bugs per https://bugzilla.mozilla.org/show_bug.cgi?id=1483958
Component: Untriaged → General
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•