korbit-ai[bot] commented on code in PR #35612:
URL: https://github.com/apache/superset/pull/35612#discussion_r2425188233
##########
superset-frontend/src/extensions/ExtensionsManager.ts:
##########
@@ -62,9 +57,6 @@ class ExtensionsManager {
* @throws Error if initialization fails.
*/
public async initializeExtensions(): Promise<void> {
- if (!isFeatureEnabled(FeatureFlag.EnableExtensions)) {
- return;
- }
const response = await SupersetClient.get({
endpoint: '/api/v1/extensions/',
});
Review Comment:
### Unconditional API call when extensions disabled <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The initializeExtensions method now unconditionally makes an API call to
fetch extensions, even when the EnableExtensions feature flag is disabled.
###### Why this matters
This will cause unnecessary network requests and potential processing of
extension data when extensions are disabled, contradicting the developer's
intent to avoid extension-related operations when the flag is off.
###### Suggested change ∙ *Feature Preview*
The feature flag check should be moved to the caller (ExtensionsStartup) or
restored in this method to prevent the API call when extensions are disabled:
```typescript
public async initializeExtensions(): Promise<void> {
if (!isFeatureEnabled(FeatureFlag.EnableExtensions)) {
return;
}
const response = await SupersetClient.get({
endpoint: '/api/v1/extensions/',
});
// ... rest of the method
}
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/86113e29-2882-4dbb-bf40-9e8fd2dff70c/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/86113e29-2882-4dbb-bf40-9e8fd2dff70c?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/86113e29-2882-4dbb-bf40-9e8fd2dff70c?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/86113e29-2882-4dbb-bf40-9e8fd2dff70c?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/86113e29-2882-4dbb-bf40-9e8fd2dff70c)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:874b300a-d1ea-46ec-9c94-055a907b5ab3 -->
[](874b300a-d1ea-46ec-9c94-055a907b5ab3)
--
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]