codeant-ai-for-open-source[bot] commented on code in PR #43350:
URL: https://github.com/apache/superset/pull/43350#discussion_r3817543310


##########
superset-frontend/src/explore/actions/hydrateExplore.ts:
##########
@@ -213,6 +279,10 @@ export const hydrateExplore =
         exploreState,
       );
     });
+    const hydratedFormData = {
+      ...initialFormData,
+      ...getFormDataFromControls(exploreState.controls),
+    };

Review Comment:
   **Suggestion:** The normalization evidence is built from 
`getFormDataFromControls`, but the existing-chart save serializes 
`explore.form_data` directly rather than this projected object. Control 
defaults or canonicalized values that exist only in control state therefore 
produce transitions whose `to_value` or presence does not match the actual 
saved params; the backend rejects those entries as stale, so automatic 
hydration changes remain visible in version history. Build the metadata from 
the same form-data representation that the save payload uses, or update that 
representation before calculating transitions. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Automatic hydration changes remain visible in chart version history.
   - ⚠️ Control defaults may be absent from the existing-chart save payload.
   - ⚠️ Version-history suppression fails for affected Explore charts.
   ```
   </details>
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/explore/actions/hydrateExplore.ts
   **Line:** 282:285
   **Comment:**
        *Api Mismatch: The normalization evidence is built from 
`getFormDataFromControls`, but the existing-chart save serializes 
`explore.form_data` directly rather than this projected object. Control 
defaults or canonicalized values that exist only in control state therefore 
produce transitions whose `to_value` or presence does not match the actual 
saved params; the backend rejects those entries as stale, so automatic 
hydration changes remain visible in version history. Build the metadata from 
the same form-data representation that the save payload uses, or update that 
representation before calculating transitions.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43350&comment_hash=fa2e798e51b3025b6bad4cd8f635552930388d0c48a46d14ba1ae902ae02a6b3&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43350&comment_hash=fa2e798e51b3025b6bad4cd8f635552930388d0c48a46d14ba1ae902ae02a6b3&reaction=dislike'>👎</a>



-- 
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