snoozz-tab-snoozing icon indicating copy to clipboard operation
snoozz-tab-snoozing copied to clipboard

[BUG] multiple copies opening after laptop goes to hibernation

Open DrunkenCommie opened this issue 3 years ago • 3 comments

Description

If the laptop goes to hibernation (long "screen down", not mere "close the lid and it sleeps" then Snoozz opens multiple copies of same sites (attached).

Expected Behavior

Open one of each snoozed sites.

Actual Behavior

Opens 2-3-4 copies of each site.

How to Reproduce (if applicable)

Laptop, close the lid, come back in 15 hours, open lid, see it happening.

Your Device

  • Browser and version: Firefox 91
  • OS: Windows 10
  • Device Resolution (UI related bugs only) 3000x2000

Which Page

Doesn't matter. Example below.

Screenshots / Videos / Logs

multiple

DrunkenCommie avatar Aug 20 '21 22:08 DrunkenCommie

I think I finally found out when this happens (it hit me today - hard). Problem is most likely caused by changing WiFi when laptop wakes up - and the Snoozz addon gets confused.

I have two SSIDs in my house, and laptop usually prefers 5GHz one - but if the signal is weak it's going to momentarily drop to 2.4GHz. So when you open a lid, laptop connects to 5GHz SSID, Snoozz thinks "oh, we have internet" and starts opening tabs that "overslept" (their wake up time was in the past, say they were supposed to wake up at 10am and it's noon already), then 5GHz signal is so weak that the laptop switches to 2.4GHz, and somehow Snoozz gets uber-confused and re-opens all these tabs again. Ouch. Of course, because it was 50+ "overslept" tabs, Firefox eats 100% of CPU so there's nothing you can do for the next 2-3 minutes and just observe the notification windows "7 tabs opened, 2 tabs opened, 5 tabs opened, ...", followed soon by the same "7 tabs opened, 2 tabs opened, 5 tabs opened, ...". And if laptop decides to switch to 5GHz again (because why not), one more "7 tabs opened....". Ouch.

(it's the same laptop, but already upgraded to Windows 11 and Firefox 98.0.1, problem occurs since "forever", August 2021)

To repro: have two SSID networks (one full-power, one barely giving signal - make that preferred network), snooze 50+ tabs (say "wake up in 5 minutes") to cause Firefox overload (it will overload while opening so many tabs), put laptop to sleep, go to a room that barely connects to the preferred-but-weak signal, wait 10 minutes (so tabs "overslept"), wake the laptop up, and weep. (so. much. tab. cleaning. needed.)

Suggestion: increase the time (to 5 seconds? 10 seconds?) before Snoozz starts opening "overslept" tabs, so that the network is 100% stable?

Edit: what I'm also testing, is I disabled notifications (those dozens of "7 tabs opened, 2 tabs opened, 5 tabs opened, ..." popups), and maybe that'll help somehow. But I really suspect it's due to that WiFi change while opening "overslept" tabs.

DrunkenCommie avatar Mar 20 '22 11:03 DrunkenCommie

Yeah thats probably it. Snoozz has several ways of triggering the "wake up" event and uses a recurring 1 hour internal alarm to recalculate the next "wake up time". When waking a computer up from sleep, or when a the computer switches between networks - this alarm is automatically triggered.

Right now there is 3 second buffer for waking up tabs - ie if you wake up a tab at 5:05PM, it will actually wake up 3 seconds after that time. I will increase the buffer to 10 seconds. Hopefully this will alleviate this niche bug you seem to be facing.

Rewriting the code for notifications before the next update to include some new options and more control for what exactly you want to see. I use built in notifications for each browser which work differently across Windows (which I don't use and can't test on) and Mac so it's a bit out of my control how they appear on your device. But hopefully these new snoozz notification controls will give you more choice in disabling ones you dont need.

rohanb10 avatar Mar 21 '22 07:03 rohanb10

It seems it's not the notifications (those pop-ups in the lower-right of the screen) that are to blame. I disabled all notifications, put the laptop to sleep (overnight, while connected to 2.4GHz - bedroom is far away from router), and when I opened the lid my laptop automatically selected 2.4GHz network. I quickly (manually) changed to 5GHz connection (say, within two seconds - laptop showed "no internet" followed by "5GHz") - exact same problem occured, just with no notifications. And now I have 50+ tabs that are doubled (and some - tripled). Ouch :)

DrunkenCommie avatar Mar 21 '22 13:03 DrunkenCommie