Skip to content

[Data] Dashboard client cache - #306004

Draft
bartoval wants to merge 10 commits into
elastic:mainfrom
bartoval:feature/dashboard_replay_cache_integration
Draft

bartoval wants to merge 10 commits into
elastic:mainfrom
bartoval:feature/dashboard_replay_cache_integration

Conversation

@bartoval

@bartoval bartoval commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Screencast.From.2026-11-19.14-36-49.mp4

/ese and /esql_async should not appear when data are cached.

  • Connects ES|QL controls and range sliders to the session cache and aligns their time window with the panels.
  • Reuses cached data when returning to saved dashboards or unsaved drafts, including returns from Lens.
  • Checks the time picker selection, pinned filters and project routing before replay.
  • Fetches missing responses using the cached time window, without an automatic refresh.
  • Refresh loads fresh data; Cancel and Discard clear the dashboard’s cache.
  • Disables “Send to background” during replay.
  • Turns Refresh yellow and shows when the cached data was loaded.

Options lists still use their own fetching path (I will do as a dedicated PR) . We only align their time window.

@bartoval bartoval self-assigned this Nov 17, 2026
@bartoval bartoval added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting ci:draft-checks Enable limited checks and AI reviews for drafts v9.7.0 labels Nov 17, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!
  • Click to trigger kibana-static-checks for this PR!

@bartoval
bartoval force-pushed the feature/dashboard_replay_cache_integration branch from 4bab7e7 to e5714ea Compare November 18, 2026 06:12
@bartoval
bartoval requested a review from drewdaemon November 18, 2026 08:31
import type { Filter, ProjectRouting, TimeRange } from '@kbn/es-query';
import { stableStringify } from '@kbn/std';

/** Compares the original time selection, pinned filters and effective project routing. */

@bartoval bartoval Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As mentioned in the Discover PR, this key is likely the same for both. It can probably be unified. I’ll take care of it in the next PR, once I’ve finished everything.

@bartoval
bartoval marked this pull request as ready for review November 20, 2026 06:59
@bartoval
bartoval requested review from a team as code owners November 20, 2026 06:59
@bartoval
bartoval requested a review from andrimal November 20, 2026 06:59
@bartoval bartoval added Team:Discover Discover, search (data plugin + KQL), data views, saved sessions, ES|QL editor (+ libraries). t// Team:Dashboards Team for Dashboard, Lens, elastic-charts, Controls, legacy editors and Canvas t// labels Nov 20, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-dashboards (Team:Dashboards)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-discover (Team:Discover)

…eplay_cache_integration

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/build_options_list_fetch_body.ts
#	src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/fetch_and_validate.test.ts
#	src/platform/plugins/shared/controls/public/controls/data_controls/range_slider/has_no_results.ts
#	src/platform/plugins/shared/controls/public/controls/data_controls/range_slider/min_max.ts
}
}
return searchSessionIdFromURL ?? dataService.search.session.start();
return searchSessionIdFromURL ?? startSearchSession();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Severity: P2 (Medium)

Wait for restored controls to publish their initial filters before treating filter emissions as search changes. On return to a dashboard with a selected range slider, fetching unpauses before the slider's filter reaches the dashboard. That initial filter then starts a fresh session, evicting the replay and advancing the time window even though the user changed nothing.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

@bartoval
bartoval marked this pull request as draft November 20, 2026 11:25
@bartoval

bartoval commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

something messed up with the last merge/conflict . I put in draft

@bartoval bartoval removed Team:Discover Discover, search (data plugin + KQL), data views, saved sessions, ES|QL editor (+ libraries). t// Team:Dashboards Team for Dashboard, Lens, elastic-charts, Controls, legacy editors and Canvas t// labels Nov 20, 2026
@bartoval
bartoval removed the request for review from andrimal November 20, 2026 11:31
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

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
controls 136.3KB 137.1KB +810.0B

Page load bundle

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

id before after diff
kbnUiSharedDeps-srcJs 5.5MB 5.5MB +1.0B
shared-plugins 12.4MB 12.4MB +109.0B
vendors-heavy 2.0MB 2.0MB +2.0B
total +112.0B
Unknown metric groups

shared async chunks total size

id before after diff
all 16.7MB 16.8MB +3.4KB

total optimizer output size

id before after diff
all 69.1MB 69.1MB +4.3KB

warm start memory

id before after diff
post forced gc heap baseline - 628312182 +628312182
post forced gc heap delta - 4500 +4500
post forced gc heap delta standard deviation - 4014634 +4014634
post forced gc heap target - 628316682 +628316682
tail heap delta - -20005118 -20005118
total +1240642880

workflow yaml validation

id before after diff
case_response.yaml (27 steps, 66 vars)/e2e/total 13 12 -1
case_response.yaml (27 steps, 66 vars)/validateVariables (66 vars) 1 2 +1
infosec_demo.yaml (150 steps, 270 vars)/e2e/performComputation 45 63 +18
infosec_demo.yaml (150 steps, 270 vars)/e2e/total 109 149 +40
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateLiquidTemplate 1 2 +1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateVariables 40 44 +4
infosec_demo.yaml (150 steps, 270 vars)/validateIfConditions 4 7 +3
infosec_demo.yaml (150 steps, 270 vars)/validateVariables (270 vars) 38 60 +22
total +88

Test Failures

  • [job] [logs] Scout Lane #15 - stateful-classic / default / local-stateful-classic - Document flyout v2 — alerts page entry - assignees: assigning the current user shows the avatar in the flyout header
  • [job] [logs] Scout Lane #17 - stateful-classic / default / local-stateful-classic - Maps - Lens choropleth chart - should allow creation of choropleth chart
  • [job] [logs] Scout Lane #17 - stateful-classic / default / local-stateful-classic - Maps - Lens choropleth chart - should create choropleth chart from suggestion
  • [job] [logs] Scout Lane #15 - stateful-classic / default / local-stateful-classic - Network flyout v2 - clicking the source.ip value in the alerts table opens the network flyout v2

History

cc @bartoval

@bartoval
bartoval force-pushed the feature/dashboard_replay_cache_integration branch from 39b6918 to 6afd8cb Compare November 20, 2026 13:21
@bartoval
bartoval force-pushed the feature/dashboard_replay_cache_integration branch from 65268a1 to 4c96da5 Compare November 20, 2026 14:46

const previousEntry = this.entries.get(assetId);
if (previousEntry) {
if (previousEntry && previousEntry.sessionId !== entry.sessionId) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Severity: P3 (Low)

Re-registering the same session now keeps its cached responses but still resets lastFetched to the registration time. An editor return that re-registers its session after a context mismatch can therefore make the next dashboard visit label old responses as freshly loaded, even though those responses were never fetched again. Preserve the previous timestamp when retaining the same session's responses.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted, replay_cache.ts is back to main.

@bartoval
bartoval force-pushed the feature/dashboard_replay_cache_integration branch from 4c96da5 to 70f7c24 Compare November 20, 2026 14:54

This branch has not been deployed

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

Labels

backport:skip This PR does not require backporting ci:draft-checks Enable limited checks and AI reviews for drafts release_note:skip Skip the PR/issue when compiling release notes v9.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants