Skip to content

[Dashboards] Fix backups service#257762

Merged
ThomThomson merged 15 commits intoelastic:mainfrom
ThomThomson:dashboard/fixBackupService
Mar 26, 2026
Merged

[Dashboards] Fix backups service#257762
ThomThomson merged 15 commits intoelastic:mainfrom
ThomThomson:dashboard/fixBackupService

Conversation

@ThomThomson
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson commented Mar 13, 2026

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.

@elasticmachine
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!

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson ThomThomson reopened this Mar 24, 2026
@ThomThomson
Copy link
Copy Markdown
Contributor Author

/ci

@ThomThomson ThomThomson added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:fix backport:version Backport to applied version labels v9.4.0 labels Mar 25, 2026
appMounted();

const [coreStart] = await core.getStartServices();
const [[coreStart], _] = await Promise.all([
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.

Dashboard plugins exposes DashboardListingTable so listing page could be rendered without initializeDashboardApiServices getting run. Instead, DashboardListingTable should call initializeDashboardApiServices as part of lazy loading.

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.

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.

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM. Nice iterative improvement to remove the race condition and clean up backup service class.
code review only

@elastic elastic deleted a comment from coderabbitai bot Mar 26, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #173 / Dataset Quality Dataset Quality Details failed docs reflects the qualityIssuesChart field state in url

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 1095 1096 +1

Async chunks

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

id before after diff
dashboard 845.0KB 843.7KB -1.3KB

Page load bundle

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

id before after diff
dashboard 18.8KB 18.9KB +102.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
dashboard 24 25 +1

Total ESLint disabled count

id before after diff
dashboard 24 25 +1

History

@ThomThomson ThomThomson merged commit 523f063 into elastic:main Mar 26, 2026
18 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23611411770

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts
9.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 257762

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 257762 locally
cc: @ThomThomson

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 257762 locally
cc: @ThomThomson

jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
Fixes the backup service not working in non-default spaces by solving the underlying race condition.
ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Apr 1, 2026
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
@ThomThomson
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Apr 1, 2026
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
@kibanamachine
Copy link
Copy Markdown
Contributor

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.
cc: @ThomThomson

paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
Fixes the backup service not working in non-default spaces by solving the underlying race condition.
@kibanamachine
Copy link
Copy Markdown
Contributor

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.
cc: @ThomThomson

3 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

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.
cc: @ThomThomson

@kibanamachine
Copy link
Copy Markdown
Contributor

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.
cc: @ThomThomson

@kibanamachine
Copy link
Copy Markdown
Contributor

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.
cc: @ThomThomson

ThomThomson added a commit that referenced this pull request Apr 6, 2026
# 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>
ThomThomson added a commit that referenced this pull request Apr 6, 2026
# 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>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.2.8 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Backups not working in non-default space

4 participants