Skip to content

Conversation

@justinpark
Copy link
Member

SUMMARY

When using the improved SQLLab persistence mode, an ID value is initially generated to manage the tab in localStorage when the tab is created. After syncing with the server, this ID is immediately replaced with the server’s tabViewId, and subsequent data synchronization uses this new ID. Since this ID serves as the key for the SQLLab tab, updating the value causes React to treat it as a new tab, resulting in the component being re-rendered.
To solve this issue, we now preserve the ID for the duration of the session and additionally store the tabViewId. We have modified the system to use tabViewId specifically for data synchronization, which resolves the problem of tab flushing.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before-query-editor-id-by-tab-id.mov

After:

after--query-editor-id-sync.mov

TESTING INSTRUCTIONS

Create a new tab, and then observe that the tab is flushed a few seconds later.

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 Aug 15, 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/hooks/useQueryEditor/index.ts
superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts
superset-frontend/src/SqlLab/types.ts
superset-frontend/src/SqlLab/components/QueryHistory/index.tsx
superset-frontend/src/reduxUtils.ts
superset-frontend/src/SqlLab/components/SouthPane/index.tsx
superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx
superset-frontend/src/SqlLab/reducers/getInitialState.ts
superset-frontend/src/SqlLab/fixtures.ts
superset-frontend/src/SqlLab/reducers/sqlLab.js
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

@sadpandajoe sadpandajoe changed the title perf(sqllab): Reduce flushing caused by ID updates fix(sqllab): Reduce flushing caused by ID updates Aug 15, 2025
@sadpandajoe sadpandajoe added the review:checkpoint Last PR reviewed during the daily review standup label Aug 15, 2025
@justinpark justinpark merged commit f8b9e3a into apache:master Aug 19, 2025
62 checks passed
@sadpandajoe sadpandajoe removed the review:checkpoint Last PR reviewed during the daily review standup label Aug 19, 2025
sadpandajoe pushed a commit that referenced this pull request Aug 20, 2025
@sadpandajoe sadpandajoe added v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch and removed 6.0 labels Aug 26, 2025
@michael-s-molina michael-s-molina mentioned this pull request Sep 11, 2025
9 tasks
@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/L 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

Development

Successfully merging this pull request may close these issues.

3 participants