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


##########
superset-frontend/src/pages/Chart/index.tsx:
##########
@@ -228,13 +228,11 @@ export default function ExplorePage() {
             t('Failed to load chart data.');
           dispatch(addDangerToast(errorMesage));
 
-          if (err.extra?.datasource) {
+          if (err.extra?.is_access_denial) {

Review Comment:
   **Suggestion:** The new access-denial path starts a second chart metadata 
request without the component's abort signal. If the Explore page unmounts 
after the initial denial but before this request completes, `isStale()` remains 
false and the request's completion handler can dispatch `hydrateExplore` into 
the global Explore store after unmount, leaving stale state for subsequent 
navigation. Pass `controller.signal` to this request and also check 
`controller.signal.aborted` before dispatching its result. [stale reference]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Denied Explore navigation can leave stale global state.
   - ⚠️ Subsequent Explore pages may receive outdated chart metadata.
   - ⚠️ Uncancelled requests continue after component unmount.
   ```
   </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=6c757feee3ce4ff5adac72e0af7bd20d&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=6c757feee3ce4ff5adac72e0af7bd20d&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/src/pages/Chart/index.tsx
   **Line:** 231:247
   **Comment:**
        *Stale Reference: The new access-denial path starts a second chart 
metadata request without the component's abort signal. If the Explore page 
unmounts after the initial denial but before this request completes, 
`isStale()` remains false and the request's completion handler can dispatch 
`hydrateExplore` into the global Explore store after unmount, leaving stale 
state for subsequent navigation. Pass `controller.signal` to this request and 
also check `controller.signal.aborted` before dispatching its result.
   
   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%2F43458&comment_hash=1463d21c995cb6a70e7c55c5198688b04559e6472635912e1e1330fe6b5c4f93&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43458&comment_hash=1463d21c995cb6a70e7c55c5198688b04559e6472635912e1e1330fe6b5c4f93&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