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

[8.13] [dashboard] fix console error "Panel not found" when linking or unlinking panel to library (#178464) #178590

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.13:

Questions ?

Please refer to the Backport tool documentation

…king panel to library (elastic#178464)

closes elastic#178442

There is a timing issue in `getComponentFromEmbeddable`.
1. `EmbeddablePanel` calls `getComponentFromEmbeddable`.
2. First `getComponentFromEmbeddable` call starts async operation `await
Promise.all([startServicesPromise, embeddablePromise])`
3. Props for `EmbeddablePanel` get updated because dashboard.panels
changes. `EmbeddablePanel` calls `getComponentFromEmbeddable` a second
time because `props.embeddable` changes.
4. Results of first `getComponentFromEmbeddable` async call return. At
this point, panels has changed and no longer contains id of old
embeddable, but `getComponentFromEmbeddable` tries to call
`untilEmbeddableLoaded` even though panel no longer exists.

PR resolves issue by
1. adding isMounted check after async action and returning null if
component is no longer mounted after `startServicesPromise,
embeddablePromise` promises return
2. Syncronizing `EmbeddablePanel` `useMemo` and `PresentationPanel`
`useAsync` dependency chain to ensure they are consistent.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 49d8083)
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
embeddable 66.2KB 66.3KB +110.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
embeddable 11 12 +1

Total ESLint disabled count

id before after diff
embeddable 13 14 +1

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nreese

@kibanamachine kibanamachine merged commit 6f8e044 into elastic:8.13 Mar 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Feature:Embedding Embedding content via iFrame
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants