Skip to content

fix(stats): Prevent crash when URL dataCategory is not chart-supported - #123706

Draft
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/stats-datacategory-crash
Draft

fix(stats): Prevent crash when URL dataCategory is not chart-supported#123706
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/stats-datacategory-crash

Conversation

@sentry

@sentry sentry Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a crash on the organization stats page (/stats/) when a dataCategory query parameter is provided for a category that is not supported by the usage chart.

Problem:
The dataCategoryInfo getter in static/app/views/organizationStats/index.tsx would resolve the dataCategory URL query parameter against all entries in DATA_CATEGORY_INFO. However, the usage chart's CHART_OPTIONS_DATACATEGORY only includes categories where statsInfo.showExternalStats is true. If a category like monitorSeats (which has showExternalStats: false) was passed via the URL, the getter would successfully resolve it, but the chart would then fail to find it in its options, leading to an Error: Selected item is not supported.

Solution:
The dataCategoryInfo getter has been updated to only consider categories where statsInfo.showExternalStats is true. This ensures that any dataCategory provided in the URL that is not chart-compatible will now correctly fall back to the default 'errors' category, preventing the crash.

A regression test has been added to static/app/views/organizationStats/index.spec.tsx to verify this behavior.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes JAVASCRIPT-39BX

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants