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


##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -412,6 +412,9 @@ const AsyncSelect = forwardRef(
           setIsLoading(false);
           return;
         }
+        // A previous fetch may have left an error on screen; clear it so the
+        // dropdown renders this fetch's outcome instead of the stale error.
+        setError('');

Review Comment:
   **Suggestion:** The error is cleared only when a network request is about to 
start. If the next search hits `allValuesLoaded` or an existing 
`fetchedQueries` cache entry, `fetchPage` returns before reaching 
`setError('')`, so the dropdown can show valid cached options together with the 
previous fetch error. Clear the error before both early-return checks, or clear 
it whenever a new fetch-page operation is requested. [stale reference]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ AsyncSelect shows errors after valid cached options return.
   - ⚠️ Create Chart datasource picker retains stale failure banners.
   - ⚠️ Native-filter dataset selection displays misleading fetch errors.
   ```
   </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)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=fd43d766ad1b4e648b9e60ae6996c18d&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=fd43d766ad1b4e648b9e60ae6996c18d&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
   **Line:** 415:417
   **Comment:**
        *Stale Reference: The error is cleared only when a network request is 
about to start. If the next search hits `allValuesLoaded` or an existing 
`fetchedQueries` cache entry, `fetchPage` returns before reaching 
`setError('')`, so the dropdown can show valid cached options together with the 
previous fetch error. Clear the error before both early-return checks, or clear 
it whenever a new fetch-page operation is requested.
   
   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%2F43629&comment_hash=0c6532764336d025755c8cf90a0de9a289eba4e4235288a7c33d57b57b00a6ff&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43629&comment_hash=0c6532764336d025755c8cf90a0de9a289eba4e4235288a7c33d57b57b00a6ff&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