You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the system goes to sleep, timers set with setTimeout (and setInterval) suspend and start ticking again on wake. We should account for this in a couple places.
In the scheduling module, rather than using lengthy timers to handle corner cases for the onIdleDaily and onIdleWeekly events, we should use shorter interval timers. With the current approach, there could be a corner case where the browser is idle 24 hours after the last onIdleDaily event and the system has been asleep in the last 24 hours. In that scenario, the event might not fire at the preferred time—it will fire when 24 hours (excluding sleep) have elapsed or when the browser next transitions from active to idle. Since this is an event that only fires at an approximate time, and since this is a corner case, not a big deal—but worth addressing eventually. We should also switch to alarms for future proofing.
In the idle module, we should clearly document that the idle detection period doesn't include time when the system is asleep. We should also clearly document that the semantics of idle vary by platform.
The text was updated successfully, but these errors were encountered:
When the system goes to sleep, timers set with
setTimeout
(andsetInterval
) suspend and start ticking again on wake. We should account for this in a couple places.scheduling
module, rather than using lengthy timers to handle corner cases for theonIdleDaily
andonIdleWeekly
events, we should use shorter interval timers. With the current approach, there could be a corner case where the browser is idle 24 hours after the lastonIdleDaily
event and the system has been asleep in the last 24 hours. In that scenario, the event might not fire at the preferred time—it will fire when 24 hours (excluding sleep) have elapsed or when the browser next transitions from active to idle. Since this is an event that only fires at an approximate time, and since this is a corner case, not a big deal—but worth addressing eventually. We should also switch toalarms
for future proofing.idle
module, we should clearly document that the idle detection period doesn't include time when the system is asleep. We should also clearly document that the semantics ofidle
vary by platform.The text was updated successfully, but these errors were encountered: