Suggested alarms / linux suspend workarounds?

Hi, I have a lightweight add-on that launches a tab at an absolute daily time using alarms. Unfortunately, I use it on a laptop that suspends frequently and the alarm is delayed by time spent suspended. From what I can gather, this is a known issue on Linux and I shouldn’t expect it fixed anytime soon? ie

Is there a suggested workaround? Waking the add-on up every few minutes to check for drift when the issue only effects Linux seems excessive, but I haven’t been able to find any better options.

Thanks for any guidance.

1 Like

Thanks for the link!
This actually explains one bug report I’ve recently received and which I couldn’t reproduce :smiley:.

But why did the issue received P5 priority?
(maybe because it’s only Linux and because at that time, Alarms API was not used much - unlike now when background scripts are not persistent anymore)

I wonder if it affects Chrome too. And I should probably investigate since this actually affects more of my extensions.

Alarm handling while a computer is asleep has come up in the WECG. I think the best issue to reference is Inconsistency: Alarms API time slipping · Issue #433 · w3c/webextensions · GitHub.

The behavior we were collectively aligning on was that time while the device was asleep should be included in the alarm’s time calculations. Or to put it another way, alarm time should be compared against a clock on the wall, not the passage of time ticks on the device.

Since those discussions, though, I don’t think there’s been any additional progress on this issue. The reason is that we generally want to align with the web’s behavior, but we realized that time handling for setTimeout() and setInterval() is not well defined on the web.

1 Like