Skip to content

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Jun 30, 2025

Enable visualizing more profiler session data by allowing users to increase the time range.

@JonasBa JonasBa requested a review from indragiek June 30, 2025 18:24
@JonasBa JonasBa requested a review from a team as a code owner June 30, 2025 18:25
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 30, 2025
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Date Validation Error Causes Component Crash

The component creates Date objects from location.query.start and location.query.end and calls .toISOString() on them. It fails to validate if these query parameters are valid date strings (only checking for string type). If an invalid date string is provided, new Date() returns an 'Invalid Date' object, causing .toISOString() to throw a RangeError and crash the component.

static/app/components/profiling/flamegraph/flamegraphToolbar/flamegraphOptionsMenu.tsx#L39-L54

const continuousLocationDescriptor: {end: string; start: string} | null =
useMemo(() => {
if (
typeof location.query.start !== 'string' ||
typeof location.query.end !== 'string' ||
typeof location.query.profilerId !== 'string'
) {
return null;
}
return {
start: new Date(location.query.start).toISOString(),
end: new Date(location.query.end).toISOString(),
};
}, [location.query]);

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@JonasBa JonasBa merged commit d0ab0ce into master Jun 30, 2025
47 checks passed
@JonasBa JonasBa deleted the jb/profiling/session-poc branch June 30, 2025 20:20
andrewshie-sentry pushed a commit that referenced this pull request Jul 14, 2025
Enable visualizing more profiler session data by allowing users to
increase the time range.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants