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

feat: query streaming only for queryService #2015

Merged
merged 1 commit into from
Mar 17, 2025
Merged

feat: query streaming only for queryService #2015

merged 1 commit into from
Mar 17, 2025

Conversation

astandrik
Copy link
Collaborator

@astandrik astandrik commented Mar 17, 2025

Closes #2011

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
264 263 0 0 1
Test Changes Summary ⏭️1

⏭️ Skipped Tests (1)

  1. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 83.21 MB | Main: 83.21 MB
Diff: +0.43 KB (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.

@@ -90,30 +90,28 @@ export const QueryEditorControls = ({
const [cancelQueryError, setCancelQueryError] = React.useState<boolean>(false);

const onStopButtonClick = React.useCallback(async () => {
if (queryId) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

already have check for sendCancelQuery

Choose a reason for hiding this comment

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

Pull Request Overview

This PR restricts query streaming functionality to occur only when using the queryService.

  • In Graph.tsx, a type guard (isValidGraphData) is introduced and memoization is used for graph data.
  • In QueryEditorControls.tsx, the conditional check for queryId is removed in the stop query function.
  • In QueryEditor.tsx, the streaming enabled condition is updated to also check that the query mode is set to query.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/containers/Tenant/Query/QueryResult/components/Graph/Graph.tsx Adds a type guard and useMemo call to validate and memoize graph data.
src/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.tsx Removes the queryId check in the stop query callback.
src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx Enhances streaming enablement logic to only allow streaming in query mode.
Comments suppressed due to low confidence (1)

src/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.tsx:92

  • The removal of the queryId check may lead to calling abortQuery even when queryId is not present. Please verify that the absence of queryId will not cause unintended behavior.
if (queryId) {
return <StubMessage message={i18n('description.graph-is-not-supported')} />;
}

return (
<div className={b('canvas-container')}>
<YDBGraph key={theme} data={{links, nodes}} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

double useEffect call in YDBGraph that was leading to clearRect error on client (caught in tests)

@astandrik astandrik added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit 105fd2c Mar 17, 2025
7 checks passed
@astandrik astandrik deleted the astandrik.2011 branch March 17, 2025 13:59
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.

query streaming only for queryService
2 participants