-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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(sql lab): MultiSelector component render twice #20706
Conversation
10b6c3e
to
ae0a82c
Compare
Codecov Report
@@ Coverage Diff @@
## master #20706 +/- ##
=======================================
Coverage 66.83% 66.83%
=======================================
Files 1750 1750
Lines 65894 65898 +4
Branches 7017 7017
=======================================
+ Hits 44041 44045 +4
Misses 20067 20067
Partials 1786 1786
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
endpoint: encodeURI(`/tableschemaview/${table.id}`), | ||
}) | ||
? Promise.all( | ||
tables.map(table => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could tables
be null
or undefined
at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory no, but added a check there
ae0a82c
to
71f1d3b
Compare
55a29d8
to
74aece8
Compare
@diegomedina248 Thank you for this hot fix! |
SUMMARY
As explained in #20702, when you select more than one table in SQL Lab and try to clear them all, then the component appears to be rerendering twice (or more).
The issue is that the tables are being removed one by one and, specially if the backend persistence is enabled, then, as the backend responds, the value of the select is updated only by that single table.
This PR ensures all tables are deleted at once, preventing the issue.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
Screen.Recording.2022-07-14.at.02.15.18.mov
After:
new.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
Fixes #20702