Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat: disabled same url check for traces query builder as well

Sahil114a979b142d
diff --git a/frontend/src/hooks/useSafeNavigate.ts b/frontend/src/hooks/useSafeNavigate.ts
index 5de8483b84..d604d0169e 100644
--- a/frontend/src/hooks/useSafeNavigate.ts
+++ b/frontend/src/hooks/useSafeNavigate.ts
@@ -13,7 +13,7 @@ interface SafeNavigateParams {
}
interface UseSafeNavigateProps {
- enableSameURLCheck?: boolean;
+ preventSameUrlNavigation?: boolean;
}
const areUrlsEffectivelySame = (url1: URL, url2: URL): boolean => {
@@ -83,7 +83,9 @@ const isDefaultNavigation = (currentUrl: URL, targetUrl: URL): boolean => {
return newKeys.length > 0;
};
export const useSafeNavigate = (
- { enableSameURLCheck }: UseSafeNavigateProps = { enableSameURLCheck: true },
+ { preventSameUrlNavigation }: UseSafeNavigateProps = {
+ preventSameUrlNavigation: true,
+ },
): {
safeNavigate: (
to: string | SafeNavigateParams,
@@ -114,7 +116,7 @@ export const useSafeNavigate = (
const urlsAreSame = areUrlsEffectivelySame(currentUrl, targetUrl);
const isDefaultParamsNavigation = isDefaultNavigation(currentUrl, targetUrl);
- if (enableSameURLCheck && urlsAreSame) {
+ if (preventSameUrlNavigation && urlsAreSame) {
return;
}
@@ -135,7 +137,7 @@ export const useSafeNavigate = (
);
}
},
- [navigate, location.pathname, location.search, enableSameURLCheck],
+ [navigate, location.pathname, location.search, preventSameUrlNavigation],
);
return { safeNavigate };
diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx
index 0cf5db736a..a896492ced 100644
--- a/frontend/src/providers/QueryBuilder.tsx
+++ b/frontend/src/providers/QueryBuilder.tsx
@@ -764,7 +764,10 @@ export function QueryBuilderProvider({
);
const { safeNavigate } = useSafeNavigate({
- enableSameURLCheck: !(initialDataSource === DataSource.LOGS),
+ preventSameUrlNavigation: !(
+ initialDataSource === DataSource.LOGS ||
+ initialDataSource === DataSource.TRACES
+ ),
});
const redirectWithQueryBuilderData = useCallback(