Skip to content

Conversation

@michael-s-molina
Copy link
Member

SUMMARY

This adds a unique immutableId field to the QueryEditor type that persists throughout the tab's lifecycle, enabling reliable event filtering and tab identification for SQL Lab extensions while maintaining backward compatibility. Previously, SQL Lab tabs could only be identified by their mutable id field, which made it difficult for extensions to reliably track events and maintain stable references to specific editor instances across state changes and persistence operations.

The addition of immutableId for tabs might help improving the current logic that uses mutable id and tabViewId introduced in #34720 to reduce re-renders. I'll let @justinpark analyze the code and check if things can be improved in a follow-up PR.

TESTING INSTRUCTIONS

Check that the events are triggered for the correct tabs.

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

@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Sep 11, 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.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/src/SqlLab/utils/reduxStateToLocalStorageHelper.ts
superset-frontend/src/SqlLab/types.ts
superset-frontend/src/SqlLab/reducers/getInitialState.ts
superset-frontend/src/SqlLab/fixtures.ts
superset-frontend/src/core/sqlLab.ts
superset-frontend/src/SqlLab/actions/sqlLab.js

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

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM with a minor test fixture comment. I'm curious, do you know wht the ids are mutable? I would have thought the main id would stay unchanged throughout the tab's lifecycle.

@michael-s-molina
Copy link
Member Author

michael-s-molina commented Sep 11, 2025

I'm curious, do you know why the ids are mutable?

I think it's because they are updated when the tab is saved on the server. @justinpark will probably know better but I'm hoping that we can improve the logic now that an immutable id is present and maybe keep the remote id in a separate variable.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Approving but hoping for remaining fixtures to also be updated!

@michael-s-molina michael-s-molina merged commit e729b2d into apache:master Sep 11, 2025
60 checks passed
michael-s-molina added a commit that referenced this pull request Sep 11, 2025
(cherry picked from commit e729b2d)
@sadpandajoe sadpandajoe added the v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch label Sep 12, 2025
sadpandajoe pushed a commit that referenced this pull request Sep 12, 2025
(cherry picked from commit e729b2d)
@github-actions github-actions bot added 🍒 6.0.0 Cherry-picked to 6.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M sqllab Namespace | Anything related to the SQL Lab v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch 🍒 6.0.0 Cherry-picked to 6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants