Skip to content

[Dashboard] Prevent duplicate saves when rapidly clicking save button#233573

Merged
nickofthyme merged 5 commits intoelastic:mainfrom
kvanerum:issue-231314
Sep 4, 2025
Merged

[Dashboard] Prevent duplicate saves when rapidly clicking save button#233573
nickofthyme merged 5 commits intoelastic:mainfrom
kvanerum:issue-231314

Conversation

@kvanerum
Copy link
Contributor

@kvanerum kvanerum commented Aug 31, 2025

Fixes #231314

Code for ignoring extra clicks was already present

The saveDashboard callback was not handling the asynchronous onSave method correctly.

…new dashboard results in multiple dashboards being created
…new dashboard results in multiple dashboards being created
# Conflicts:
#	src/platform/plugins/shared/dashboard/public/dashboard_api/save_modal/save_modal.tsx
@kvanerum kvanerum requested a review from a team as a code owner August 31, 2025 10:18
@ThomThomson ThomThomson added backport:version Backport to applied version labels v9.2.0 v8.19.4 release_note:skip Skip the PR/issue when compiling release notes labels Sep 2, 2025
@ThomThomson
Copy link
Contributor

@elasticmachine merge upstream

@ThomThomson
Copy link
Contributor

/ci

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Changes LGTM! Thank you for the contribution, and using the method shorthand here makes sense.

@ThomThomson
Copy link
Contributor

@elasticmachine merge upstream

@ThomThomson
Copy link
Contributor

/ci

@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 623.0KB 623.0KB -2.0B

History

@Heenawter
Copy link
Contributor

@elasticmachine run docs-build

@nreese
Copy link
Contributor

nreese commented Sep 4, 2025

Not sure if anyone has seen #233933 but these same to be related fixes

Copy link
Contributor

@nickofthyme nickofthyme Sep 4, 2025

Choose a reason for hiding this comment

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

Yeah this may solve the issue for dashboards but the modal logic is not consistently expecting the onSave call to return a promise all the way up the call stack to the root async function performing the save.

That said I think it's still worth merging this PR and giving @kvanerum credit for the fix until #233933 get reviewed and merged.

@nickofthyme nickofthyme changed the title Rapidly clicking save button in save dashboard modal when creating a new dashboard results in multiple dashboards being created [Dashboard] Prevent duplicate saves when rapidly clicking save button Sep 4, 2025
@nickofthyme nickofthyme merged commit c2c4c80 into elastic:main Sep 4, 2025
17 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 4, 2025
…elastic#233573)

Fixes elastic#231314

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit c2c4c80)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 4, 2025
…elastic#233573)

Fixes elastic#231314

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit c2c4c80)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 4, 2025
…button (#233573) (#234097)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Dashboard] Prevent duplicate saves when rapidly clicking save button
(#233573)](#233573)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kris Van
Erum","email":"34942518+kvanerum@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-09-04T19:29:33Z","message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","💝community","backport:version","v9.2.0","v9.1.4","v8.19.4"],"title":"[Dashboard]
Prevent duplicate saves when rapidly clicking save
button","number":233573,"url":"https://github.com/elastic/kibana/pull/233573","mergeCommit":{"message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233573","number":233573,"mergeCommit":{"message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892"}},{"branch":"9.1","label":"v9.1.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kris Van Erum <34942518+kvanerum@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Sep 4, 2025
… button (#233573) (#234096)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Dashboard] Prevent duplicate saves when rapidly clicking save button
(#233573)](#233573)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kris Van
Erum","email":"34942518+kvanerum@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-09-04T19:29:33Z","message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","💝community","backport:version","v9.2.0","v9.1.4","v8.19.4"],"title":"[Dashboard]
Prevent duplicate saves when rapidly clicking save
button","number":233573,"url":"https://github.com/elastic/kibana/pull/233573","mergeCommit":{"message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/233573","number":233573,"mergeCommit":{"message":"[Dashboard]
Prevent duplicate saves when rapidly clicking save button
(#233573)\n\nFixes #231314 \n\n---------\n\nCo-authored-by: Elastic
Machine
<elasticmachine@users.noreply.github.com>","sha":"c2c4c80926ef266f43a882983e68cc253c75b892"}},{"branch":"9.1","label":"v9.1.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kris Van Erum <34942518+kvanerum@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kvanerum kvanerum deleted the issue-231314 branch September 5, 2025 06:31
shahargl pushed a commit to shahargl/kibana that referenced this pull request Sep 7, 2025
…elastic#233573)

Fixes elastic#231314 

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
KodeRad pushed a commit to KodeRad/kibana that referenced this pull request Sep 15, 2025
…elastic#233573)

Fixes elastic#231314 

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…elastic#233573)

Fixes elastic#231314 

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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 💝community release_note:skip Skip the PR/issue when compiling release notes v8.19.4 v9.1.4 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rapidly clicking save button in save dashboard modal when creating a new dashboard results in multiple dashboards being created

7 participants