Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/modern-doors-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---

fix: Disable useSessionId query when traceId input is undefined
2 changes: 1 addition & 1 deletion packages/app/src/components/DBRowSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const DBRowSidePanel = ({
}, [timestampDate]);

const focusDate = timestampDate;
const traceId = normalizedRow?.['__hdx_trace_id'];
const traceId: string | undefined = normalizedRow?.['__hdx_trace_id'];

const childSourceId =
source.kind === 'log'
Expand Down
8 changes: 4 additions & 4 deletions packages/app/src/components/DBSessionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export const useSessionId = ({
enabled = false,
}: {
sourceId?: string;
traceId: string;
traceId?: string;
dateRange: [Date, Date];
enabled?: boolean;
}) => {
// trace source
const { data: source } = useSource({ id: sourceId });

const config = useMemo(() => {
if (!source) {
if (!source || !traceId) {
return;
}
return {
Expand Down Expand Up @@ -54,10 +54,10 @@ export const useSessionId = ({
}, [source, traceId]);

const { data } = useEventsData({
config: config!, // ok to force unwrap, the query will be disabled if source is null
config: config!, // ok to force unwrap, the query will be disabled if config is null
dateRangeStartInclusive: true,
dateRange,
enabled: enabled && !!source,
enabled: enabled && !!source && !!config,
});

const result = useMemo(() => {
Expand Down
10 changes: 4 additions & 6 deletions packages/app/src/components/DBTracePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import { SourceKind } from '@hyperdx/common-utils/dist/types';
import {
Badge,
Button,
Center,
Divider,
Expand All @@ -19,7 +18,6 @@ import { DBTraceWaterfallChartContainer } from '@/components/DBTraceWaterfallCha
import { useSource, useUpdateSource } from '@/source';
import TabBar from '@/TabBar';

import ServiceMap from './ServiceMap/ServiceMap';
import { RowDataPanel } from './DBRowDataPanel';
import { RowOverviewPanel } from './DBRowOverviewPanel';
import { SourceSelectControlled } from './SourceSelect';
Expand All @@ -41,7 +39,7 @@ export default function DBTracePanel({
}: {
parentSourceId?: string | null;
childSourceId?: string | null;
traceId: string;
traceId?: string;
dateRange: [Date, Date];
focusDate: Date;
// Passed in from side panel to try to identify which
Expand All @@ -54,7 +52,7 @@ export default function DBTracePanel({
};
'data-testid'?: string;
}) {
const { control, watch, setValue } = useForm({
const { control, watch } = useForm({
defaultValues: {
source: childSourceId,
},
Expand Down Expand Up @@ -192,7 +190,7 @@ export default function DBTracePanel({
</Stack>
)}
<Divider my="sm" />
{traceSourceData?.kind === SourceKind.Trace && (
{traceSourceData?.kind === SourceKind.Trace && traceId && (
<DBTraceWaterfallChartContainer
traceTableSource={traceSourceData}
logTableSource={logSourceData}
Expand Down Expand Up @@ -246,7 +244,7 @@ export default function DBTracePanel({
)}
</>
)}
{traceSourceData != null && !eventRowWhere && (
{traceSourceData != null && !eventRowWhere && traceId && (
<Paper shadow="xs" p="xl" mt="md">
<Center mih={100}>
<Text size="sm">Please select a span above to view details.</Text>
Expand Down
Loading