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): flaky json explore modal due to over-rendering #26156

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Dec 1, 2023

SUMMARY

The queries state contains the status and results of running and completed queries, making it fragile. Since the SouthPane observes the entire queries state, it often causes over-rendering. This means that the current result panel will trigger rendering at each interval of checking pending queries.

This causes the visibility of the JSON modal to be flaky because the modal disappears when it is re-rendered.
This commit reduces the observation of queries properties to resolve the over-rendering issue. (As a result, the completed result panel component will not be disturbed by the status updates of other pending queries.)

In addition, this commit enhances the queriesLastUpdate timestamp by incrementally updating it only when its query result remains unchanged.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--overrendering.mov

Screenshot 2023-11-29 at 10 58 17 AM

After:

Issue is gone

after--overrendering.mov

Screenshot 2023-11-30 at 8 32 44 PM

TESTING INSTRUCTIONS

Go to SQL Lab and run a query contains a json blob
Select a table in order to execute a table preview query
Click Results tab before the table preview query ends and then click the JSON column to open the JSON modal
Check the JSON modal persists while the async query status is updating

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

@justinpark justinpark linked an issue Dec 1, 2023 that may be closed by this pull request
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (9a13ec6) 69.10% compared to head (bafd85f) 69.13%.
Report is 17 commits behind head on master.

Files Patch % Lines
...ontend/src/SqlLab/components/SouthPane/Results.tsx 71.42% 1 Missing and 3 partials ⚠️
...ntend/src/SqlLab/components/QueryHistory/index.tsx 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26156      +/-   ##
==========================================
+ Coverage   69.10%   69.13%   +0.03%     
==========================================
  Files        1940     1942       +2     
  Lines       75869    75886      +17     
  Branches     8445     8452       +7     
==========================================
+ Hits        52427    52462      +35     
+ Misses      21267    21250      -17     
+ Partials     2175     2174       -1     
Flag Coverage Δ
javascript 56.34% <85.36%> (+0.06%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@justinpark justinpark merged commit f30f685 into apache:master Dec 7, 2023
32 checks passed
@michael-s-molina michael-s-molina added the v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch label Dec 8, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 8, 2023
justinpark added a commit to justinpark/superset that referenced this pull request Dec 15, 2023
justinpark added a commit to justinpark/superset that referenced this pull request Dec 15, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 18, 2023
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
@justinpark justinpark mentioned this pull request Jan 24, 2024
9 tasks
@justinpark justinpark deleted the fix--sqllab-unexpected-flash-json-modal-due-to-overrender branch January 24, 2024 21:50
@mistercrunch mistercrunch added 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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/XL v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.1.0 🍒 3.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants