Skip to content

fix: guard against undefined resources_string in dashboard list panel#10816

Open
tbachlechner wants to merge 3 commits intoSigNoz:mainfrom
tbachlechner:fix/dashboard-list-panel-log-click-crash
Open

fix: guard against undefined resources_string in dashboard list panel#10816
tbachlechner wants to merge 3 commits intoSigNoz:mainfrom
tbachlechner:fix/dashboard-list-panel-log-click-crash

Conversation

@tbachlechner
Copy link
Copy Markdown

@tbachlechner tbachlechner commented Apr 2, 2026

Summary

Fixes #10815 — clicking a log row in a dashboard list panel crashes the frontend.

Root Cause

getFiltersFromResources() in frontend/src/container/LogsExplorerContext/utils.ts calls Object.keys(resources) where resources is log.resources_string. When a log is rendered in a dashboard list panel (not the Logs explorer), resources_string can be undefined, causing:

TypeError: undefined is not an object (evaluating 'Object.keys(e)')

Fix

Add nullish coalescing: Object.keys(resources ?? {}) — returns an empty array when resources_string is undefined, so no filters are created and the log detail view opens normally.

Test plan

  • Open a dashboard with a list panel querying logs
  • Click on a log row — should open log detail view without crash
  • Verify Logs explorer page still works (resources_string is populated there)

Made with Cursor


Note

Low Risk
Low risk defensive change that prevents a frontend crash when resources_string is missing; behavior when resources are present is unchanged.

Overview
Prevents crashes when opening log details from dashboard list panels by making getFiltersFromResources tolerate an undefined resources_string (treats it as an empty object and returns no resource-derived filters).

Updates the ILog type so resources_string is allowed to be undefined, aligning the type with observed API/UI usage.

Written by Cursor Bugbot for commit 86a4656. This will update automatically on new commits. Configure here.

Clicking a log row in a dashboard list panel crashes with:
TypeError: undefined is not an object (evaluating 'Object.keys(e)')

The crash occurs in getFiltersFromResources() when log.resources_string
is undefined. This happens because logs rendered in dashboard list panels
may not have the resources_string property populated.

Fix: add nullish coalescing (resources ?? {}) before calling Object.keys().

Fixes SigNoz#10815

Made-with: Cursor
@tbachlechner tbachlechner requested a review from a team as a code owner April 2, 2026 21:34
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ tbachlechner
❌ Thomas bachlechner


Thomas bachlechner seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread frontend/src/container/LogsExplorerContext/utils.ts
H4ad
H4ad previously approved these changes Apr 3, 2026
@H4ad H4ad added bug Something isn't working frontend safe-to-test Run CI tests for dependabot and external contributors dashboard-panel labels Apr 3, 2026
@primus-bot primus-bot Bot removed the safe-to-test Run CI tests for dependabot and external contributors label Apr 3, 2026
@H4ad H4ad added the safe-to-test Run CI tests for dependabot and external contributors label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dashboard-panel frontend safe-to-test Run CI tests for dependabot and external contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend crash when clicking log row in dashboard list panel

3 participants