Skip to content

Conversation

villebro
Copy link
Member

SUMMARY

Currently we're logging that extensions are initialized successfully even if the feature flag isn't set. This moves the feature flag check one level up to avoid triggering this log unless the FF is enabled.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

korbit-ai[bot]
korbit-ai bot previously requested changes Oct 13, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Unconditional API call when extensions disabled ▹ view
Files scanned
File Path Reviewed
superset-frontend/src/extensions/ExtensionsStartup.tsx
superset-frontend/src/extensions/ExtensionsManager.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 59 to 62
public async initializeExtensions(): Promise<void> {
if (!isFeatureEnabled(FeatureFlag.EnableExtensions)) {
return;
}
const response = await SupersetClient.get({
endpoint: '/api/v1/extensions/',
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unconditional API call when extensions disabled category Functionality

Tell me more
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:

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

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the check was moved one level up, so that this is never triggered if the flag is unset.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for clarifying. The higher-level check addresses the concern about unnecessary API calls when extensions are disabled.

@dosubot dosubot bot added the logging Creates a UI or API endpoint that could benefit from logging. label Oct 13, 2025
@michael-s-molina
Copy link
Member

Good catch @villebro. You need to move the tests that check for single initialization from ExtensionsManager.test.ts to ExtensionsStartup.test.tsx.

@pull-request-size pull-request-size bot added size/L and removed size/S labels Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logging Creates a UI or API endpoint that could benefit from logging. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants