-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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): Async queries are now fetched properly #21698
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21698 +/- ##
==========================================
- Coverage 66.84% 66.68% -0.16%
==========================================
Files 1799 1799
Lines 68902 68869 -33
Branches 7324 7313 -11
==========================================
- Hits 46057 45927 -130
- Misses 20955 21062 +107
+ Partials 1890 1880 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@lyndsiWilliams Container image not yet published for this PR. Please try again when build is complete. |
@lyndsiWilliams Ephemeral environment creation failed. Please check the Actions logs for details. |
prevQuery?.resultsKey && | ||
query.resultsKey !== prevQuery.resultsKey | ||
) { | ||
if (query.resultsKey && query.resultsKey !== prevQuery?.resultsKey) { |
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.
is there any case where the refetch button
will appear since we are removing this case?
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.
It should work normally, as it did before the refactor. Before the refactor the if statement looked like this:
if (
nextProps.query.resultsKey &&
nextProps.query.resultsKey !== this.props.query.resultsKey
)
So I don't think prevQuery?.resultsKey &&
was supposed to be there in the first place.
/testenv up |
@lyndsiWilliams Ephemeral environment spinning up at http://34.216.3.212:8080. Credentials are |
Thank you for covering the async queries logic with unit tests |
Can we merge it? |
This needs QA check before it can be merged. I've notified QA, once it's reviewed I'll merge it. |
22177da
to
2ee28bd
Compare
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR fixes a bug introduced by (#21186) that caused async queries to always render a refetch button on the first query fetch. This is because the first time an async query is run it doesn't have a prevQuery (previous query). Once the query is run (refetched through the button), there's an existing prevQuery so it would always work on the second click.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:
AFTER:
TESTING INSTRUCTIONS
Asynchronous query execution
enabledNote: This also happens in the result set when you click "run", but that route is currently blocked. There is a fix available for this route here: #21667 - I pulled down this branch and tested, I can confirm that this also works for running queries and getting a full result (not just a table preview).
ADDITIONAL INFORMATION