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): wiped out unsaved changes by delayed actions #21877

Conversation

justinpark
Copy link
Member

SUMMARY

When a user switches to a tab before the slow table list fetch (such like db_exports) completed, it accidentally wiped out the current unsaved changes. This bug makes SQL Lab randomly resets the code to an earlier state.

This commit fixes the bug by updating the queryEditors object directly when the request queryEditor is not active state.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before
wiped-out-draft-text--before.mov
  • After
wiped-out-draft-text--after.mov

TESTING INSTRUCTIONS

  • Go to Sqllab and open multiple tabs
  • set network throttle to slow 3G
  • Switch to other tab and then immediately switch to the another tab
  • Type anything on sqllab editor and then check any random revert

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

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Merging #21877 (587b2be) into master (52d33b0) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #21877      +/-   ##
==========================================
- Coverage   66.90%   66.90%   -0.01%     
==========================================
  Files        1805     1805              
  Lines       69073    69082       +9     
  Branches     7369     7378       +9     
==========================================
+ Hits        46214    46220       +6     
  Misses      20952    20952              
- Partials     1907     1910       +3     
Flag Coverage Δ
javascript 53.29% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/reducers/sqlLab.js 36.87% <100.00%> (+1.64%) ⬆️
...ls/DndColumnSelectControl/DndAdhocFilterOption.tsx 50.00% <0.00%> (-50.00%) ⬇️
...ols/DndColumnSelectControl/utils/optionSelector.ts 24.13% <0.00%> (-13.80%) ⬇️
...ontrols/DndColumnSelectControl/DndMetricSelect.tsx 47.45% <0.00%> (-13.58%) ⬇️
...et-frontend/src/dashboard/actions/dashboardInfo.ts 50.00% <0.00%> (-11.54%) ⬇️
.../src/explore/components/ControlPanelsContainer.tsx 77.37% <0.00%> (-2.79%) ⬇️
...gin-chart-echarts/src/Timeseries/transformProps.ts 51.72% <0.00%> (-1.85%) ⬇️
.../src/dashboard/components/gridComponents/Chart.jsx 53.57% <0.00%> (-1.48%) ⬇️
...plore/components/controls/OptionControls/index.tsx 77.17% <0.00%> (-0.85%) ⬇️
...-frontend/src/dashboard/reducers/dashboardState.js 76.08% <0.00%> (-0.51%) ⬇️
... and 41 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ktmud ktmud merged commit fb8231b into apache:master Oct 27, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 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 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants