korbit-ai[bot] commented on code in PR #35810:
URL: https://github.com/apache/superset/pull/35810#discussion_r2453623501


##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx:
##########
@@ -664,6 +664,8 @@ class DatasourceEditor extends PureComponent {
       usageChartsCount: 0,
     };
 
+    this.isComponentMounted = false;

Review Comment:
   ### Mount guard initialized incorrectly <sub>![category 
Performance](https://img.shields.io/badge/Performance-4f46e5)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The mount guard flag is initialized to false in the constructor, which means 
async operations that complete before componentDidMount will be incorrectly 
blocked.
   
   
   ###### Why this matters
   This creates a race condition where fast-completing async operations (like 
cached responses) may be blocked from updating state even when the component is 
actually mounted, leading to incomplete UI updates.
   
   ###### Suggested change ∙ *Feature Preview*
   Initialize `isComponentMounted` to `true` in the constructor since the 
component is being constructed and will be mounted, or move the initialization 
to `componentDidMount` only:
   
   ```javascript
   // Option 1: Initialize to true
   this.isComponentMounted = true;
   
   // Option 2: Only set in componentDidMount (remove from constructor)
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/76ce94ab-11c6-42ce-a75b-9927759b10d0/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/76ce94ab-11c6-42ce-a75b-9927759b10d0?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/76ce94ab-11c6-42ce-a75b-9927759b10d0?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/76ce94ab-11c6-42ce-a75b-9927759b10d0?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/76ce94ab-11c6-42ce-a75b-9927759b10d0)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:12b1ced2-1a9d-41a8-aef5-60310bebf6ff -->
   
   
   [](12b1ced2-1a9d-41a8-aef5-60310bebf6ff)



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