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

Discover Code loading race condition with embeddables #70470

Closed
flash1293 opened this issue Jul 1, 2020 · 2 comments · Fixed by #70920
Closed

Discover Code loading race condition with embeddables #70470

flash1293 opened this issue Jul 1, 2020 · 2 comments · Fixed by #70920
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

Kibana version: 7.8

Describe the bug: In some cases the "search" embeddable is registered too late, causing the embeddable to fail to render in a dashboard.

Steps to reproduce:
Put a saved search on a dashboard and reload (multiple times). This depends on the specific timing of requests

Seen here:
https://discuss.elastic.co/t/embeddable-factory-embeddablefactoryid-search-does-not-exist/239270

Expected behavior:

The search embeddable should always be registered in the setup phase with async steps.

Any additional context:

This can happen because code is loaded async before the embeddable is registered:

plugins: DiscoverSetupPlugins

This means it's not registered in the setup phase and can leak into the start phase. We should register the factory during setup, then load the actual embeddable and other stuff async when it's used the first time.

@flash1293 flash1293 added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure :KibanaApp/fix-it-week labels Jul 1, 2020
@kertal kertal self-assigned this Jul 6, 2020
@kertal
Copy link
Member

kertal commented Jul 7, 2020

dear @flash1293 , totally makes sense, working on a fix in #70920. one question, could you reproduce it locally? thx!

@flash1293
Copy link
Contributor Author

@kertal I couldn't reproduce so far, but it should be easy to enforce by putting a long running await in front of the dynamic import to simulate a delay in loading this bundle.

Like function delay() { return new Promise((resolve) => { setTimeout(resolve, 5000) }) } await delay().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants