question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can someone please disable backgroundThrottling to prevent missed timers and notifications?

See original GitHub issue

Your Environment

  • Version used: 7.10.1 (but probably all versions)
  • Operating System and version: Windows 10 Pro (20H2)

Expected Behavior

Get all notifications/sounds (idle, pomodoro, etc) in time.

Current Behavior

Randomly, timers go into negative values and don’t trigger notifications/sounds nor update the tray progress until you unminimize the window using the hotkey. I think it might be because of backgroundThrottling mentioned in this stackoverflow answer: https://stackoverflow.com/a/59610324/12781687 I can’t build the repo, so if someone could please add this to electron/main-window.ts for the next build, it would be great.

mainWindow = new BrowserWindow({
...
    webPreferences: {
...
        backgroundThrottling: false,
    },
});

From electron docs:

backgroundThrottling boolean (optional) - Whether to throttle animations and timers when the page becomes background. This also affects the Page Visibility API. Defaults to true.

Steps to Reproduce (for bugs)

  1. Can’t reproduce reliably, best chance is to let the timer run. And if you keep your ram full to 90% or so for a few minutes, you increase the chances of it staying unresponsive even after you no longer overload ram/cpu. (Kinda like chrome, so not sure this backgroundThrottling would totally fix it, but might help.)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
johannesjocommented, Apr 28, 2022

Thanks for opening this up! I’ll add this setting and it should be available for the next snap edge release (and for self compiled builds from the master branch). I hope there not to bad negative side effects (such as the increased resource usage), so feedback on this would be very welcome!

0reactions
RationalFragilecommented, Aug 27, 2022

Yes, this issue should be closed. I couldn’t wait 4 months for the release, so what I realized is that I can use the installer version of super productivity and then I would be able to extract the .asar and modify it directly; and that’s what I did.

So I already tested it for a month or so and it solved the issue of missed timers. And didn’t introduce any issues. Anyway, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"backgroundThrottling: false" no longer affects ... - GitHub
Disabling background throttling should prevent the slowdowns/pausing of both animation frames and intervals/timeouts when the window is in ...
Read more >
Latest iOS 16.2 Beta Lets You Disable Wallpaper and ...
Toggling off wallpaper will remove your wallpaper when you have always on display enabled, and toggling off notifications will prevent ...
Read more >
FYI: how to disable timer throttling on Google Chrome - Reddit
go to chrome://flags/ yes, you can type that into URL bar. in the search, type "throttle". You're going to get 3 options, the...
Read more >
Intent to Ship: Expensive Background Timer Throttling
Yes, I think this is true. Having worked to stop the circumvention of ad blockers for a while we see browser APIs abused...
Read more >
BrowserWindow | Electron
If backgroundThrottling is disabled, the visibility state will remain visible even if the window is minimized, occluded, or hidden.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found