Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop function in generateWait (generator.ts) never ends #2606

Closed
tomaszkunicki opened this issue Mar 23, 2022 · 4 comments
Closed

Loop function in generateWait (generator.ts) never ends #2606

tomaszkunicki opened this issue Mar 23, 2022 · 4 comments

Comments

@tomaszkunicki
Copy link

Description

When transition is processed (loop) the local variable (done) is not incremented in result loop function never ends.

Steps to check or reproduce

Check in the debugger. The line with callback is not executed.

@netil
Copy link
Member

netil commented Mar 24, 2022

Hi @tomaszkunicki, could you provide precise reproducible example?

In a simple legend toggle transition, it works.
Kapture 2022-03-24 at 11 05 41

@tomaszkunicki
Copy link
Author

tomaszkunicki commented Mar 25, 2022

I think this is the case when the tab is not visible. I think the assumption was the transition should be emptied.
If the function is called when the tab is not visible, it loops forever. It seems the generateWait is called even though the tab is not visible.
So, it works in regular condition, but when we lock the desktop (and tabs are hidden then) and after while I'm getting back to charts the browser processes millions of timers.

@tomaszkunicki
Copy link
Author

I'm still investigating the issue. All I see that after a while I can get 100% utilization and 5 million of d3 timer tasks.

It seems that this fix works for me.

adremsoft@21d98b2

@netil
Copy link
Member

netil commented Mar 25, 2022

I think this is the case when the tab is not visible. I think the assumption was the transition should be emptied.

Tested triggering some API to simulate, but even tab is hidden the callback called.
To prevent any situation, where the loop never ends, adding bulletproof code will prevent or mitigate.

netil added a commit to netil/billboard.js that referenced this issue Mar 25, 2022
Add bulletproof code, when tab isn't visible terminate the loop.

Ref naver#2606
netil added a commit to netil/billboard.js that referenced this issue Mar 25, 2022
Add bulletproof code, when tab isn't visible terminate the loop.

Ref naver#2606
@netil netil closed this as completed in bafdb17 Mar 25, 2022
github-actions bot pushed a commit that referenced this issue Mar 31, 2022
# [3.4.0](3.3.3...3.4.0) (2022-03-31)

### Bug Fixes

* **api:** Fix flow on indexed/category axis type ([4aba436](4aba436)), closes [#2595](#2595)
* **axis:** Fix culling visibility on dynamic loading ([4c79daf](4c79daf)), closes [#2582](#2582)
* **axis:** fix hidden axis rescale on dynamic load ([5418853](5418853)), closes [#2523](#2523) [#2571](#2571)
* **generator:** Prevent possible infinite loop when tab isn't visible ([bafdb17](bafdb17)), closes [#2606](#2606)
* **option:** Fix data.hide not working for bubble/scatter type ([64ae74b](64ae74b)), closes [#2609](#2609)
* **util:** Check if agent has mouse ([d42adaa](d42adaa)), closes [#2550](#2550) [#2585](#2585)
* **util:** Enhance parsing date string ([8d9f422](8d9f422)), closes [#1714](#1714)

### Features

* **api:** Implement axis range reset ([6c9d99e](6c9d99e)), closes [#2398](#2398)
* **option:** Intent to ship onclick ([63c5a53](63c5a53)), closes [#2587](#2587)
* **polar:** Intent to ship polar type ([feca715](feca715)), closes [#2462](#2462)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants