codeant-ai-for-open-source[bot] commented on PR #38859:
URL: https://github.com/apache/superset/pull/38859#issuecomment-4129845611

   ## **Sequence Diagram**
   
   This PR updates MCP save flows to re-load dashboards and charts using the 
active db session instead of DAO lookups, preventing stale session failures 
after commit in multi-tenant setups. It also limits top-level error handling to 
expected exception types for clearer failure responses.
   
   ```mermaid
   sequenceDiagram
       participant Client
       participant MCP Tool
       participant Command
       participant DB Session
       participant Serializer
   
       Client->>MCP Tool: Request to generate or update dashboard or chart
       MCP Tool->>Command: Save or update entity
       Command-->>MCP Tool: Return saved entity
       MCP Tool->>DB Session: Requery same entity with eager relations
   
       alt Requery succeeds
           DB Session-->>MCP Tool: Session bound entity
       else Requery fails
           DB Session-->>MCP Tool: Database error
           MCP Tool->>MCP Tool: Fallback to saved entity
       end
   
       MCP Tool->>Serializer: Serialize entity for response
       MCP Tool-->>Client: Return success or specific handled error
   ```
   
   ---
   *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]

Reply via email to