mavo icon indicating copy to clipboard operation
mavo copied to clipboard

Expression evaluation does not happen when tab is inactive

Open LeaVerou opened this issue 5 years ago • 7 comments

We use requestAnimationFrame() for each computation cycle, which as it turns out is paused in inactive tabs. While in many cases this doesn't matter, @karger came across a case where it did (he was using expressions + custom JS to trigger notifications when data change). We should switch to using setTimeout() with an appropriate timeout. That will also be slowed to 1s in inactive tabs, but at least it won't be paused completely.

We should do a code review and replace any other critical rAFs as well.

LeaVerou avatar Dec 03 '20 15:12 LeaVerou

hey @LeaVerou ! I would like to contribute however I have quite basic knowledge of Js

Mayank1728 avatar Feb 15 '22 09:02 Mayank1728

Hey @LeaVerou ! Is this issue still exists ? Would like to contribute on this

GauravThakur543 avatar Jun 11 '23 15:06 GauravThakur543

@DmitrySharabin Can we add something to CONTRIBUTING.md that says "Please don't ask if you can contribute, if it's a small issue just submit a PR, if it's a larger issue, and you have the experience to tackle it, just discuss your proposed design".

LeaVerou avatar Jun 12 '23 14:06 LeaVerou

@DmitrySharabin Can we add something to CONTRIBUTING.md that says "Please don't ask if you can contribute, if it's a small issue just submit a PR, if it's a larger issue, and you have the experience to tackle it, just discuss your proposed design".

Sure, Lea. Will do it today.

DmitrySharabin avatar Jun 12 '23 15:06 DmitrySharabin