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.

fix: prefer local storage list options over url query options and handle an edge case (#7120)

Shaheer Kochai7e1301b8d256
diff --git a/frontend/src/pages/LogsExplorer/index.tsx b/frontend/src/pages/LogsExplorer/index.tsx
index e4b1b82da3..b988a43b5f 100644
--- a/frontend/src/pages/LogsExplorer/index.tsx
+++ b/frontend/src/pages/LogsExplorer/index.tsx
@@ -94,10 +94,7 @@ function LogsExplorer(): JSX.Element {
if (!data) return null;
try {
- const parsed = JSON.parse(data);
- const hasValidColumns = Array.isArray(parsed?.selectColumns);
-
- return hasValidColumns ? parsed.selectColumns : null;
+ return JSON.parse(data);
} catch {
return null;
}
@@ -132,16 +129,11 @@ function LogsExplorer(): JSX.Element {
// Skip if already migrated
if (query.version) return query;
- // Case 1: query has columns
- if (query.selectColumns.length > 0) {
- return {
- ...query,
- version: 1,
- selectColumns: mergeWithRequiredColumns(query.selectColumns),
- };
+ if (logListOptionsFromLocalStorage?.version) {
+ return logListOptionsFromLocalStorage;
}
- // Case 2: No query columns in but we have localStorage columns
+ // Case 1: we have localStorage columns
if (logListOptionsFromLocalStorage?.selectColumns?.length > 0) {
return {
...query,
@@ -152,6 +144,15 @@ function LogsExplorer(): JSX.Element {
};
}
+ // Case 2: No query columns in localStorage in but query has columns
+ if (query.selectColumns.length > 0) {
+ return {
+ ...query,
+ version: 1,
+ selectColumns: mergeWithRequiredColumns(query.selectColumns),
+ };
+ }
+
// Case 3: No columns anywhere, use defaults
return {
...query,
@@ -159,7 +160,7 @@ function LogsExplorer(): JSX.Element {
selectColumns: defaultLogsSelectedColumns,
};
},
- [mergeWithRequiredColumns, logListOptionsFromLocalStorage?.selectColumns],
+ [mergeWithRequiredColumns, logListOptionsFromLocalStorage],
);
useEffect(() => {