advanced-github-notifier icon indicating copy to clipboard operation
advanced-github-notifier copied to clipboard

Not updating notifications after waking up sleep machine

Open tw0517tw opened this issue 8 years ago • 11 comments
trafficstars

This addon will not update notifications after I wake my machine up. Maybe there is some time it has no Internet connection so fetching fails and it stop to retry.

OS: Windows 10 Firefox Developer Edition 57.0b2 Advanced GitHub Notifier 1.2.1

tw0517tw avatar Sep 26 '17 02:09 tw0517tw

I'm having the same or a similar issue. In one instance it showed [1] notification waiting but showed two notifications in the drop-down, and I had no notifications on GitHub (which seems like a partially-resolved state).

OS: macOS Sierra 10.12.6 Firefox 55.0.3 Advanced GitHub Notifier 1.2.1

iamed2 avatar Sep 26 '17 02:09 iamed2

The extension should not be running while your device is in sleep mode. Even if it is, on Mac OS and Windows it will not fetch updates as long as the system says there is no internet access. As soon as internet access is back, the polling resumes (not that it will at most check for updates every 60 seconds and never more frequent, unless GitHub changes policy). What I could imagine is Firefox having a bug where online state is not properly restored when resuming, though that would then also affect most messaging web apps, for example.

@iamed2 That is a different issue that should be resolved in upcoming versions. There are cases in 1.2.1 where the badge is not properly updated.

freaktechnik avatar Sep 26 '17 04:09 freaktechnik

Next time this happens, could you check the Browser Console for errors and enable XHR logging to see if the polling is still working (it should be polling api.github.com/notifications).

freaktechnik avatar Sep 26 '17 04:09 freaktechnik

It stops checking for notifications until I restart Firefox. I verified that it isn't polling using the Browser Console. A similar extension, Checker Plus for Gmail, is still able to poll for messages.

iamed2 avatar Sep 26 '17 15:09 iamed2

Actually, I think I know how this is happening: updates are scheduled to exact time, since GitHub requires me to follow the polling interval they send in a header. However that time will be over once the machine is resumed, thus aborting the update loop.

freaktechnik avatar Sep 26 '17 15:09 freaktechnik

Was recommended to use https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/idle/onStateChanged for this.

freaktechnik avatar Sep 26 '17 15:09 freaktechnik

It has been brought to my attention that this is actually confirmed a Firefox Platform bug. No reason not to work around it for now though. See https://bugzilla.mozilla.org/show_bug.cgi?id=1359403

freaktechnik avatar Sep 26 '17 16:09 freaktechnik

Hmm, just tried to reproduce this on a Linux machine and didn't have any success. I'll try on Windows when I get a chance. Though that does sound like a different platform bug.

freaktechnik avatar Sep 27 '17 11:09 freaktechnik

I can't reproduce on Windows 10 either. I tried both, sleeping longer than the interval of the polling and shorter and in neither case the polling stopped.

freaktechnik avatar Oct 11 '17 14:10 freaktechnik

I can't reproduce on Windows 10 either

It happens for me all the time. It was the reason why I stopped using the addon in the first place months ago, problem still persists when I rechecked today with Windows 10 + Firefox 61. Notifications Preview for GitHub works without problems, but maybe it doesn't run into that FF bug because it's not displayed in the main ui?

tooomm avatar Jul 12 '18 20:07 tooomm

Yeah, I experience it often too, however I am convinced that it is not sleep related, but instead is related to mis-calculating the next request time and thus the update loop stopping, since I experience it on Linux with the computer running for 8h+. Disabling and re-enabling the extension usually fixes it, which only strengthens my suspicion, but I have so far not been able to identify when exactly this could happen.

freaktechnik avatar Jul 12 '18 20:07 freaktechnik