Skip to content

fix: unnecessary background refresh on query page #1256

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

Merged

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Sep 4, 2024

Stand

Closes #1210

need to redo #1198

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
124 117 0 7 0

Bundle Size: ✅

Current: 78.86 MB | Main: 78.86 MB
Diff: 0.00 MB (-0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@astandrik astandrik force-pushed the astandrik.unnecessary-background-refresh-on-query-page-1210-2 branch from 651730c to e16eb71 Compare September 4, 2024 14:05
@astandrik astandrik marked this pull request as ready for review September 6, 2024 09:17
@astandrik astandrik requested a review from ValeraS September 9, 2024 17:52

return (
<React.Fragment>
<ElapsedTime className={b('elapsed-time')} />
Copy link
Contributor

Choose a reason for hiding this comment

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

As for me ElapsedTime should not be a part of CancelQueryButton.

import ElapsedTime from '../../../../components/ElapsedTime/ElapsedTime';
import {cancelQueryApi} from '../../../../store/reducers/cancelQuery';
import {cn} from '../../../../utils/cn';
import i18n from '../i18n';
Copy link
Contributor

Choose a reason for hiding this comment

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

lets do i18n for this component separately

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why?

we have all actions there
image

if (resultType === RESULT_TYPES.EXPLAIN) {
const {plan, ast, simplifiedPlan} = explainQueryData || {};
if (result?.type === ResultType.EXPLAIN) {
const {plan, ast, simplifiedPlan} = result.data || {};
Copy link
Contributor

Choose a reason for hiding this comment

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

if we pass result as a property, whats the use is passing it's attributes one more time?

showPreview,
} = props;
const {tenantPath: savedPath} = executeQuery;

const [resultType, setResultType] = React.useState<ValueOf<typeof RESULT_TYPES>>();
const [isResultLoaded, setIsResultLoaded] = React.useState(false);
const isResultLoaded = Boolean(executeQuery.result);
Copy link
Contributor

Choose a reason for hiding this comment

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

why only executeQuery.result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

executeQuery.result can be both execute or explain type

@@ -335,7 +325,7 @@ function QueryEditor(props: QueryEditorProps) {
<QueryEditorControls
handleSendExecuteClick={handleSendExecuteClick}
onSettingsButtonClick={handleSettingsClick}
isLoading={explainQueryResult.isLoading || executeQueryResult.isLoading}
isLoading={Boolean(executeQuery.result?.isLoading)}
Copy link
Contributor

Choose a reason for hiding this comment

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

why only executeQuery?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

executeQuery.result can be both execute or explain type

@astandrik astandrik merged commit 04b4313 into main Sep 13, 2024
6 checks passed
@astandrik astandrik deleted the astandrik.unnecessary-background-refresh-on-query-page-1210-2 branch September 13, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unnecessary background refresh on query page
3 participants