Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sqllab): run previous state query #29230

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

A rare bug has occurred in SQL Lab where queries from the previous state are being executed.
This bug happens because SQL Lab no longer unmounts the ace editor when tabs are changed.
As a result, the state before the tab change is hoisted in the editor's shortcut callback function, causing it to request the previous state's query.

This commit addresses the issue by ensuring that the latest query state from Redux is always passed.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--out-of-update-query.mov

After:

after--out-of-update-query.mov

TESTING INSTRUCTIONS

Go to SQL Lab and then open a new tab from the existing tab
Select a different database option from the previous cloned option
Type any sql in the editor and then hit run
Switch to the previous tab and then make a selection in the sql editor
Switch back to the new tab and then click the sql editor to focus in the editor and then hit "Ctrl + Enter" to run query via shortcut
Please check the query run with the editor's state (not the default sql, SELECT ...)

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 #bug:newfeature Bugs related to newly introduced features sqllab Namespace | Anything related to the SQL Lab labels Jun 12, 2024
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jun 12, 2024
@justinpark justinpark merged commit a889796 into apache:master Jun 12, 2024
34 of 36 checks passed
@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Jun 13, 2024
michael-s-molina pushed a commit that referenced this pull request Jun 13, 2024
@mistercrunch mistercrunch added 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 24, 2024
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 #bug:newfeature Bugs related to newly introduced features size/M sqllab Namespace | Anything related to the SQL Lab v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants