[Dashboards] Fix backups service#257762
Conversation
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
| appMounted(); | ||
|
|
||
| const [coreStart] = await core.getStartServices(); | ||
| const [[coreStart], _] = await Promise.all([ |
There was a problem hiding this comment.
Dashboard plugins exposes DashboardListingTable so listing page could be rendered without initializeDashboardApiServices getting run. Instead, DashboardListingTable should call initializeDashboardApiServices as part of lazy loading.
There was a problem hiding this comment.
Unfortunately, after the app is mounted we aren't using the lazy loaded DashboardListingTable, so this is actually a 3rd spot where we'll need to initialize the api services.
I recognize that this isn't a great long term pattern. As an alternative, we could look into having a universal async dashboard setup function that imports the module, waits for the kibana services to be available, and initializes the dashboard api services.
nreese
left a comment
There was a problem hiding this comment.
LGTM. Nice iterative improvement to remove the race condition and clean up backup service class.
code review only
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
|
Starting backport for target branches: 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/23611411770 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Fixes the backup service not working in non-default spaces by solving the underlying race condition.
Fixes the backup service not working in non-default spaces by solving the underlying race condition. (cherry picked from commit 523f063) # Conflicts: # src/platform/plugins/shared/dashboard/public/dashboard_api/load_dashboard_api/load_dashboard_api.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/unsaved_changes_manager.test.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/unsaved_changes_manager.ts # src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/share_options_utils.ts # src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.test.tsx # src/platform/plugins/shared/dashboard/public/dashboard_renderer/dashboard_module.ts # src/platform/plugins/shared/dashboard/public/services/kibana_services.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Fixes the backup service not working in non-default spaces by solving the underlying race condition. (cherry picked from commit 523f063) # Conflicts: # src/platform/plugins/shared/dashboard/jest_setup.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/load_dashboard_api/load_dashboard_api.test.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/load_dashboard_api/load_dashboard_api.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/save_modal/save_dashboard.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/unsaved_changes_manager.test.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/unsaved_changes_manager.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/view_mode_manager.ts # src/platform/plugins/shared/dashboard/public/dashboard_app/no_data/dashboard_app_no_data.tsx # src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/share_options_utils.ts # src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.test.tsx # src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx # src/platform/plugins/shared/dashboard/public/dashboard_listing/dashboard_unsaved_listing.test.tsx # src/platform/plugins/shared/dashboard/public/dashboard_listing/dashboard_unsaved_listing.tsx # src/platform/plugins/shared/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.test.tsx # src/platform/plugins/shared/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx # src/platform/plugins/shared/dashboard/public/dashboard_renderer/dashboard_module.ts # src/platform/plugins/shared/dashboard/public/plugin.tsx # src/platform/plugins/shared/dashboard/public/services/kibana_services.ts
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Fixes the backup service not working in non-default spaces by solving the underlying race condition.
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
3 similar comments
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
# Backport This will backport the following commits from `main` to `9.2`: - [[Dashboards] Fix backups service (#257762)](#257762) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Devon Thomson","email":"devon.thomson@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T18:30:04Z","message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","loe:medium","impact:high","backport missing","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[Dashboards] Fix backups service","number":257762,"url":"https://github.com/elastic/kibana/pull/257762","mergeCommit":{"message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/257762","number":257762,"mergeCommit":{"message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Backport This will backport the following commits from `main` to `9.3`: - [[Dashboards] Fix backups service (#257762)](#257762) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Devon Thomson","email":"devon.thomson@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T18:30:04Z","message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","loe:medium","impact:high","backport missing","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[Dashboards] Fix backups service","number":257762,"url":"https://github.com/elastic/kibana/pull/257762","mergeCommit":{"message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/257762","number":257762,"mergeCommit":{"message":"[Dashboards] Fix backups service (#257762)\n\nFixes the backup service not working in non-default spaces by solving the underlying race condition.","sha":"523f0637b94930dc02701221aeec844986f3ff87"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes #257761 by solving the underlying race condition. This PR also cleans up the dashboard backup service as a whole and removes some unneeded error toasts.