Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Embeddables Rebuild] Fix unsaved changes on new dashboards bug (#184955
) Closes #184174 ## Summary This PR fixes the bug where, on a new and unsaved dashboard, adding both a legacy embeddable and an image embeddable would result in a dashboard getting stuck with unsaved changes on the first save. This was caused by a race condition - since the `debounce` on the React embeddable unsaved changes observable was **before** the `switchMap`, the React embeddable observable fired **immediately** on save which then triggered the `diffingSubscription` to fire too early. **Before:** https://github.com/elastic/kibana/assets/8698078/44be114a-0c6d-4f40-a5c1-c05889d53ace **After:** https://github.com/elastic/kibana/assets/8698078/52f50fd4-0e8f-4aff-8fe6-19b9038623ee
- Loading branch information