Skip to content

[9.1] [dashboard] fixs controls cause double fetch (#237169)#237364

Merged
nreese merged 1 commit intoelastic:9.1from
nreese:backport/9.1/pr-237169
Oct 2, 2025
Merged

[9.1] [dashboard] fixs controls cause double fetch (#237169)#237364
nreese merged 1 commit intoelastic:9.1from
nreese:backport/9.1/pr-237169

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Oct 2, 2025

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

Fixes elastic#237147

PR updates dashboard to wait until controls are ready before rendering
panels. This prevents a double fetch when panels would fetch data while
controls where building filters and then fetch data again once controls
filters are available.

This PR introduces a small performance degradation to dashboards with
controls. Panels will not start rendering until controls have finished
initializing. This is a better performance trade-off then the current
behavior of issuing a new round of requests once controls are ready.

### Testing
* install sample web logs
* create new dashboard
* add options list control on field `machine.os.keyword`
* Select `ios` in control
* add metric vis with count
* save dashboard
* open dashboard filter network requests to `ese`. Ensure metric chart
only makes a single request
<img width="2048" height="698" alt="Screenshot 2025-10-01 at 12 39
45 PM"
src="https://github.com/user-attachments/assets/b24e039c-2585-4eec-af9b-e459fccf90d7"
/>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 7f7bd4f)

# Conflicts:
#	src/platform/plugins/shared/dashboard/public/dashboard_api/control_group_manager.ts
#	src/platform/plugins/shared/dashboard/public/dashboard_api/get_dashboard_api.ts
#	src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts
#	src/platform/plugins/shared/dashboard/public/dashboard_renderer/viewport/dashboard_viewport.tsx
@nreese nreese requested a review from kibanamachine as a code owner October 2, 2025 17:39
@nreese nreese added the backport This PR is a backport of another PR label Oct 2, 2025
@nreese nreese enabled auto-merge (squash) October 2, 2025 17:39
@nreese nreese merged commit 66cca87 into elastic:9.1 Oct 2, 2025
16 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 618.5KB 619.0KB +437.0B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants