Skip to content

fix: enable oidc streaming #2537

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
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
useTypedSelector,
} from '../../../../utils/hooks';
import {useChangedQuerySettings} from '../../../../utils/hooks/useChangedQuerySettings';
import {useDisableOidcStreaming} from '../../../../utils/hooks/useDisableOidcStreaming';
import {useLastQueryExecutionSettings} from '../../../../utils/hooks/useLastQueryExecutionSettings';
import {DEFAULT_QUERY_SETTINGS, QUERY_ACTIONS, QUERY_MODES} from '../../../../utils/query';
import {useCurrentSchema} from '../../TenantContext';
Expand Down Expand Up @@ -95,14 +94,10 @@ export default function QueryEditor(props: QueryEditorProps) {
const [lastExecutedQueryText, setLastExecutedQueryText] = React.useState<string>('');
const [isQueryStreamingEnabled] = useSetting<boolean>(ENABLE_QUERY_STREAMING);

// Temporary check: disable streaming if backend parameter contains "oidc"
const isOidcBackend = useDisableOidcStreaming();

const isStreamingEnabled =
useStreamingAvailable() &&
isQueryStreamingEnabled &&
querySettings.queryMode === QUERY_MODES.query &&
!isOidcBackend;
querySettings.queryMode === QUERY_MODES.query;

const [sendQuery] = queryApi.useUseSendQueryMutation();
const [streamQuery] = queryApi.useUseStreamQueryMutation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {HelpMark, Switch} from '@gravity-ui/uikit';
import {cn} from '../../../../utils/cn';
import {ENABLE_QUERY_STREAMING} from '../../../../utils/constants';
import {useSetting} from '../../../../utils/hooks';
import {useDisableOidcStreaming} from '../../../../utils/hooks/useDisableOidcStreaming';

import {QUERY_SETTINGS_FIELD_SETTINGS} from './constants';
import i18n from './i18n';
Expand All @@ -21,12 +20,7 @@ interface TimeoutLabelProps {
export function TimeoutLabel({isDisabled, isChecked, onToggle}: TimeoutLabelProps) {
const [isQueryStreamingEnabled] = useSetting<boolean>(ENABLE_QUERY_STREAMING);

// Temporary check: disable streaming UI if backend parameter contains "oidc"
const isOidcBackend = useDisableOidcStreaming();

const shouldShowStreamingUI = isQueryStreamingEnabled && !isOidcBackend;

if (shouldShowStreamingUI) {
if (isQueryStreamingEnabled) {
return (
<div className={b('switch-title')}>
<Switch
Expand Down
10 changes: 0 additions & 10 deletions src/utils/hooks/useDisableOidcStreaming.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/utils/hooks/useQueryExecutionSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
querySettingsRestoreSchema,
} from '../query';

import {useDisableOidcStreaming} from './useDisableOidcStreaming';
import {useSetting} from './useSetting';

export const useQueryExecutionSettings = () => {
Expand All @@ -25,11 +24,6 @@ export const useQueryExecutionSettings = () => {
const [useShowPlanToSvg] = useSetting<boolean>(USE_SHOW_PLAN_SVG_KEY);
const [enableQueryStreaming] = useSetting<boolean>(ENABLE_QUERY_STREAMING);

// Temporary check: disable streaming behavior if backend parameter contains "oidc"
const isOidcBackend = useDisableOidcStreaming();

const effectiveStreamingEnabled = enableQueryStreaming && !isOidcBackend;

const setQueryExecutionSettings = React.useCallback(
(settings: QuerySettings) => {
setSettings({
Expand All @@ -45,7 +39,7 @@ export const useQueryExecutionSettings = () => {
const settings: QuerySettings = {
...validatedSettings,
timeout:
effectiveStreamingEnabled && validatedSettings.queryMode === QUERY_MODES.query
enableQueryStreaming && validatedSettings.queryMode === QUERY_MODES.query
? validatedSettings.timeout || null
: validatedSettings.timeout || undefined,
statisticsMode: useShowPlanToSvg ? STATISTICS_MODES.full : validatedSettings.statisticsMode,
Expand Down
Loading