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


##########
superset-frontend/src/middleware/asyncEvent.ts:
##########
@@ -587,7 +598,11 @@ export const waitForAsyncData = async <T = unknown[]>(
   return refetch(taskIds);
 };
 
-export const init = (appConfig?: AppConfig) => {
+export const init = (
+  appConfig?: AppConfig,
+  pollingTransport: AsyncQueryPollingTransport = defaultFetchStatusChanges,
+) => {
+  fetchStatusChanges = pollingTransport;

Review Comment:
   **Suggestion:** Reinitializing replaces the transport globally while 
existing waiters may still be active, so their polling can use a different 
client and their state can be discarded. [stale reference]
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely`
   
   [![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=ac8cc7388bd7447583ac43f846785965&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=ac8cc7388bd7447583ac43f846785965&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/middleware/asyncEvent.ts
   **Line:** 605:605
   **Comment:**
        *Stale Reference: Reinitializing replaces the transport globally while 
existing waiters may still be active, so their polling can use a different 
client and their state can be discarded.
   
   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%2F43941&comment_hash=706747e3331e76cc0645692ab2b5dff5eaf34cac6b4048728111df0e9a65aa0f&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43941&comment_hash=706747e3331e76cc0645692ab2b5dff5eaf34cac6b4048728111df0e9a65aa0f&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset/initialization/__init__.py:
##########
@@ -1040,6 +1040,7 @@ def init_app_in_ctx(self) -> None:
         self.configure_ssh_manager()
         self.configure_stats_manager()
         self.configure_task_manager()
+        self.configure_async_queries()

Review Comment:
   **Suggestion:** `configure_async_queries()` runs even when GTF and async 
queries are disabled, so custom managers initialize resources and hooks in 
synchronous deployments where those prerequisites are absent. [logic error]
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes`
   
   [![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=eb323f88523540c1bb0ab4e736f0f018&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=eb323f88523540c1bb0ab4e736f0f018&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/initialization/__init__.py
   **Line:** 1043:1043
   **Comment:**
        *Logic Error: `configure_async_queries()` runs even when GTF and async 
queries are disabled, so custom managers initialize resources and hooks in 
synchronous deployments where those prerequisites are absent.
   
   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%2F43941&comment_hash=70931e7f6876aa44d9e90f505c59fccc35d73e0d20ead75807fe03006f5d55af&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43941&comment_hash=70931e7f6876aa44d9e90f505c59fccc35d73e0d20ead75807fe03006f5d55af&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