codeant-ai-for-open-source[bot] commented on PR #38156:
URL: https://github.com/apache/superset/pull/38156#issuecomment-3941667233
## **Sequence Diagram**
Shows how favorite-status thunks now verify the current dashboard ID from
Redux state before updating UI or showing error toasts, preventing stale API
responses from affecting a newly viewed dashboard.
```mermaid
sequenceDiagram
participant DashboardView
participant ReduxThunk
participant SupersetAPI
participant ReduxState
DashboardView->>ReduxThunk: fetchFaveStar(id) / saveFaveStar(id, ...)
ReduxThunk->>SupersetAPI: call favorite_status or favorites endpoint
SupersetAPI-->>ReduxThunk: response (success or error)
ReduxThunk->>ReduxState: read dashboardInfo.id (currentId)
alt currentId === requested id
ReduxThunk-->>DashboardView: dispatch toggleFaveStar or
addDangerToast
else stale response (IDs differ)
ReduxThunk-->>ReduxState: silently ignore response (no dispatch)
end
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]