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


##########
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx:
##########
@@ -351,6 +357,15 @@ const PropertiesModal = ({
     // refresh") rather than falling through to the dropdown value (#42116).
     jsonMetadataObj.refresh_frequency =
       jsonMetadataObj.refresh_frequency ?? refreshFrequency;
+    // Persist the per-dashboard async override (unless set directly in the
+    // Advanced JSON editor). 'default' clears it so the deployment default 
applies.
+    if (jsonMetadataObj.async_mode === undefined) {
+      if (asyncMode === 'default') {
+        delete jsonMetadataObj.async_mode;
+      } else {
+        jsonMetadataObj.async_mode = asyncMode;
+      }
+    }

Review Comment:
   **Suggestion:** The Advanced JSON editor is initialized from metadata that 
still contains an existing `async_mode`, so `jsonMetadataObj.async_mode` is 
already defined whenever a dashboard has a prior override. The conditional 
therefore skips the selector value entirely, preventing users from changing or 
clearing an existing `force_on` or `force_off` setting. Exclude this field from 
the editor copy or otherwise distinguish an intentional editor edit from the 
existing value before applying the selector. [incorrect condition logic]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Dashboard selector cannot change existing async overrides.
   - ❌ Dashboard selector cannot restore deployment-default behavior.
   - ⚠️ Users can still edit `async_mode` manually in Advanced JSON.
   ```
   </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/dashboard/components/PropertiesModal/index.tsx
   **Line:** 360:368
   **Comment:**
        *Incorrect Condition Logic: The Advanced JSON editor is initialized 
from metadata that still contains an existing `async_mode`, so 
`jsonMetadataObj.async_mode` is already defined whenever a dashboard has a 
prior override. The conditional therefore skips the selector value entirely, 
preventing users from changing or clearing an existing `force_on` or 
`force_off` setting. Exclude this field from the editor copy or otherwise 
distinguish an intentional editor edit from the existing value before applying 
the selector.
   
   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%2F43429&comment_hash=37abf35ebcd8c135ec80471a5b0256c83406455ae40838216b3f9829c4c0524e&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43429&comment_hash=37abf35ebcd8c135ec80471a5b0256c83406455ae40838216b3f9829c4c0524e&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