[Embeddable] Allow panels to pause data fetching#235266
[Embeddable] Allow panels to pause data fetching#235266ThomThomson merged 5 commits intoelastic:mainfrom
Conversation
|
/ci |
|
/ci |
|
/ci |
|
/ci |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
|
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, Data Discovery changes LGTM 👍
@ThomThomson will this be on by default? |
|
@drewdaemon this PR doesn't actually add this functionality. That will be added in a followup. You can see how it will work by taking a look at #225372. In short, it will be a Dashboard-level setting. And it will be on by default for new Dashboards. If the |
...rm/packages/shared/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts
Show resolved
Hide resolved
|
|
||
| // trigger a refetch | ||
| dashboadFilters.next([]); | ||
| dashboadFilters.next([{ meta: {} }]); |
There was a problem hiding this comment.
What does meta do? Should this use reload API?
There was a problem hiding this comment.
This PR introduces diffing into the keys of the fetch context before firing the requests. Adding this blank filter object triggers a diff which makes the request fire again. Meta is there because it's required by the type.
In this test, firing an update with a blank array fails the diff and doesn't trigger a refetch. I thought that using filters here would retain the spirit of the test better than switching to reload, but either would work IMO.
There was a problem hiding this comment.
Thanks for the explanation. Makes sense and its only a test
nreese
left a comment
There was a problem hiding this comment.
kibana-presentation changes LGTM
code review only
|
Starting backport for target branches: 9.2 https://github.com/elastic/kibana/actions/runs/18230425368 |
Gives the Embeddable system the ability to arbitrarily pause and unpause data fetching (cherry picked from commit b54c117)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
|
Canceling the backport of this PR to 9.2 as the existing bugfix is enough. This will allow a performance improvement in 9.3 and above. |
Gives the Embeddable system the ability to arbitrarily pause and unpause data fetching
Summary
Gives the Embeddable system the ability to arbitrarily pause and unpause fetching, while allowing panels to continue with code-loading tasks.
This will be used to increase performance of the double fetch bug fix for controls, and will be used to fetch data for visible panels only.
Notice how in the gif above the panels are finished their initialization but there are no network requests for data yet. When
isFetchPaused$is turned back to false the network requests begin.How to test
This code is currently unused in the actual product, however you can test its behaviour by adding
isFetchPaused$to the Dashboard API. AddisFetchPaused$: concat(of(true), of(false).pipe(delay(10000))),after line 129 ofsrc/platform/plugins/shared/dashboard/public/dashboard_api/get_dashboard_api.ts