[Lens] Infinite reference accumulation#245317
Merged
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
dej611
approved these changes
Dec 10, 2025
nreese
reviewed
Dec 10, 2025
nreese
approved these changes
Dec 11, 2025
Contributor
nreese
left a comment
There was a problem hiding this comment.
LGTM - thanks for removing dashboard specific reference name logic.
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
seanrathier
pushed a commit
to seanrathier/kibana
that referenced
this pull request
Dec 15, 2025
Fixes issue with some Lens panels on a dashboard that would create duplicate `references`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue where Lens panels on a dashboard that have no references, like a vis with ad-hoc dataview (i.e. ES|QL), will blindly add dashboard references. But these references are not always panel-specific thus lens will absorb all dashboard references.
Details
In #239029 we moved the lens
referencesto the server and passed them in the SO underattributes.referencesuntil the references can be properly injected into the state itself.Previously we were filtering the panel
referencesfrom the dashboard with the references fromattributes.references. But with the transforms now being run on the client side code, the dashboardreferencescan be empty, see #239029 (comment). Thus we need to merge these two reference sources.kibana/x-pack/platform/plugins/shared/lens/common/embeddable_factory/index.ts
Lines 31 to 46 in b8f3c71
But additionally, the dashboard may pass the
transformOutmethod all the unfiltered rawreferenceswhen the filter references are empty.kibana/src/platform/plugins/shared/dashboard/server/api/transforms/out/transform_panels_out.ts
Line 36 in 440e3d5
The solution is to treat the lens
attributes.referencesas the source of truth and only use the dashboard panel references to update theidon matching references bynameandtype.fixes #245283
Checklist
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.