rusackas commented on PR #38156: URL: https://github.com/apache/superset/pull/38156#issuecomment-4625570342
@aminghadersohi great catch on `savePublished` — you're right, it had the exact same race condition this PR fixes for the favorite-star thunks. Its `.then()`/`.catch()` dispatched the success/error toasts and `togglePublished` with no `currentId === id` guard, so publishing and navigating away before the PUT resolved would surface "This dashboard is now published" on the wrong dashboard. Fixed in 979ed16df0: threaded `getState` through `savePublishedThunk` and gated every dispatch on the dashboard ID still being current, mirroring `fetchFaveStar`/`saveFaveStar`. Also added a `savePublished race condition` test block covering all four branches (success/error × id-matches/id-changed). Thanks for the review! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
