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): avoid unexpected re-rendering on DatabaseSelector #21141

Conversation

justinpark
Copy link
Member

SUMMARY

This bug has been accidentally introduced from #17044.

Since DatabaseSelector component has an unnecessary key, DatabaseSelector will be re-mounted rather than update whenever currentDatabase object is updated. This causes the unexpected duplicate database list api request.
This commit removes this key so will skip unnecessary re-rendering and data fetching.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

fix--unnecessary-dabaseselector-rerendering

After:

Screen Shot 2022-08-19 at 2 50 12 PM

TESTING INSTRUCTIONS

go to Sql Editor and check the network list

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

cc: @betodealmeida

@justinpark justinpark force-pushed the fix--sqllab-unexpected-database-selector-rerendering branch from 85b5bc2 to 61ea48c Compare August 19, 2022 22:10
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 Aug 19, 2022

Codecov Report

Merging #21141 (85b5bc2) into master (252ceb7) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 85b5bc2 differs from pull request most recent head 61ea48c. Consider uploading reports for the commit 61ea48c to get more accurate results

@@            Coverage Diff             @@
##           master   #21141      +/-   ##
==========================================
- Coverage   66.32%   66.32%   -0.01%     
==========================================
  Files        1772     1772              
  Lines       67651    67653       +2     
  Branches     7205     7205              
==========================================
+ Hits        44867    44868       +1     
- Misses      20941    20942       +1     
  Partials     1843     1843              
Flag Coverage Δ
javascript 52.08% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...et-frontend/src/components/TableSelector/index.tsx 76.59% <100.00%> (+0.50%) ⬆️
superset-frontend/src/SqlLab/actions/sqlLab.js 59.83% <0.00%> (-0.28%) ⬇️

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

@zhaoyongjie zhaoyongjie merged commit a1389d3 into apache:master Aug 22, 2022
justinpark added a commit to justinpark/superset that referenced this pull request Aug 24, 2022
@justinpark justinpark mentioned this pull request Aug 24, 2022
9 tasks
@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/XS 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants