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

fix: missing scene issue #255 #233

Merged
merged 1 commit into from
Jan 30, 2023
Merged

fix: missing scene issue #255 #233

merged 1 commit into from
Jan 30, 2023

Conversation

NorbertNader
Copy link
Contributor

@NorbertNader NorbertNader commented Jan 30, 2023

Overview

This will fix the missing scene issue by safeguard against race condition where the scene gets constructed and immediately removed.

first race condition:

  • If componentDidUnload is called before componentDidLoad this.el.isConnected will be false
  • This can happen when scrolling page very quickly
  • If the component is unmounted before this.setupChartScene is complete we run into a race condition
    where the scene gets created and assigned to this.scene but we override it with null before
    this.setupChartScene calls this.onUpdate
  • Without the component mounted there is no point in calling onUpdate since we have nowhere to render this.scene

second race condition:

  • if one of the watched props e.g. dataStreams changes this will call onUpdate
  • if the component unmounts before this this.scene is set to null
  • if we do not have a scene or a component to render it in we should bail

Legal

This project is available under the Apache 2.0 License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants