fix: guard against undefined resources_string in dashboard list panel#10816
Open
tbachlechner wants to merge 3 commits intoSigNoz:mainfrom
Open
fix: guard against undefined resources_string in dashboard list panel#10816tbachlechner wants to merge 3 commits intoSigNoz:mainfrom
tbachlechner wants to merge 3 commits intoSigNoz:mainfrom
Conversation
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
|
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. |
H4ad
reviewed
Apr 3, 2026
H4ad
previously approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #10815 — clicking a log row in a dashboard list panel crashes the frontend.
Root Cause
getFiltersFromResources()infrontend/src/container/LogsExplorerContext/utils.tscallsObject.keys(resources)whereresourcesislog.resources_string. When a log is rendered in a dashboard list panel (not the Logs explorer),resources_stringcan beundefined, causing:Fix
Add nullish coalescing:
Object.keys(resources ?? {})— returns an empty array whenresources_stringis undefined, so no filters are created and the log detail view opens normally.Test plan
Made with Cursor
Note
Low Risk
Low risk defensive change that prevents a frontend crash when
resources_stringis missing; behavior when resources are present is unchanged.Overview
Prevents crashes when opening log details from dashboard list panels by making
getFiltersFromResourcestolerate an undefinedresources_string(treats it as an empty object and returns no resource-derived filters).Updates the
ILogtype soresources_stringis allowed to beundefined, aligning the type with observed API/UI usage.Written by Cursor Bugbot for commit 86a4656. This will update automatically on new commits. Configure here.