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

[TSVB] Adding check for model and visData #13854

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

simianhacker
Copy link
Member

This PR adds a check for the model and visData properties. These two values should essentially never be null. Due to a recent PR there is now a race condition which requires us to check to make sure these values are valid before rendering the rest of the React tree.

@simianhacker simianhacker added Feature:TSVB TSVB (Time Series Visual Builder) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v6.0.0 v6.0.0-rc1 v7.0.0 labels Sep 5, 2017
@ppisljar
Copy link
Member

ppisljar commented Sep 6, 2017

this is the PR that broke this: #13742

  • visualization's constructor will get called during initialization
  • if visualization controler has an init function it will get called (it should return a promise)
  • once the init function promise is resolved (or if no init function straight away) vis.initialized is set
  • after vis.initialized is set the request is executed (to ES)
  • after data is received the render function is called (with params and visData)

however in the editor example it goes a bit differently:

  • editor constructor gets called
  • editors render method gets called
  • editor will probably init the visualization (and if not it should set vis.initialized itself)
    the normal flow described above follows.
    ... after data is received editor render method gets called again with the data

in this PR #13779 tsvb editor sets the vis.initialized in its constructor. now the race condition starts.

  • editor render method will get called right after the constructor is executed
  • but request to ES already started and when we get response editor render method will get called with data

i think this should be fixed on visualize side. editors render method (the first time, without data) should not be called if editor set the vis.initialized in constructor (which means request to backend is pending)

pr to do that: #13858

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but maybe its not needed after we address the issue in visualize

@simianhacker simianhacker merged commit 8ff37dc into elastic:master Sep 6, 2017
@simianhacker
Copy link
Member Author

it's probably not as necessary but I think it's good to have these checks.

@simianhacker
Copy link
Member Author

Back ported to 6.0 with ad6f53e
Back ported to 6.x with 4c538fe

simianhacker added a commit to simianhacker/kibana that referenced this pull request Sep 6, 2017
simianhacker added a commit that referenced this pull request Sep 7, 2017
simianhacker added a commit that referenced this pull request Sep 7, 2017
simianhacker added a commit that referenced this pull request Sep 7, 2017
@simianhacker simianhacker deleted the fix-tsvb branch April 17, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v6.0.0-rc1 v6.0.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants