Skip to content

Conversation

@scttcper
Copy link
Member

Displays the title etc of the issue that is being shown in the example stack trace section and lets you randomly view another.

image

Displays the title etc of the issue that is being shown in the example stack trace section and lets you randomly view another.
@scttcper scttcper requested a review from cvxluo January 12, 2026 23:21
@scttcper scttcper requested a review from a team as a code owner January 12, 2026 23:21
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 12, 2026

// eslint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
setStackTraceGroupId(cluster.group_ids[0]!);
}, [cluster.group_ids]);
Copy link
Contributor

Choose a reason for hiding this comment

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

State not reset when group IDs become empty

Low Severity

The useEffect that syncs stackTraceGroupId with cluster.group_ids returns early when the array is empty, but doesn't reset the state to 0. If cluster.group_ids changes from a non-empty array to an empty one, stackTraceGroupId retains its stale value. Since the render condition is stackTraceGroupId > 0, this causes the component to attempt rendering a stack trace for a group ID that no longer belongs to the cluster.

Fix in Cursor Fix in Web

next = cluster.group_ids[Math.floor(Math.random() * cluster.group_ids.length)]!;
}
return next;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential infinite loop with duplicate group IDs

Low Severity

The handleRandomizeStackTrace while loop only exits when a different ID is found (next !== prev). If cluster.group_ids contains duplicate values (e.g., [123, 123]), the loop has no exit condition and will run forever, freezing the browser. While group IDs are expected to be unique, the algorithm has no safeguard like a maximum iteration count to prevent this scenario.

Fix in Cursor Fix in Web

@scttcper scttcper merged commit 08f02e3 into master Jan 13, 2026
54 checks passed
@scttcper scttcper deleted the scttcper/dynamic-grouping-randomize branch January 13, 2026 18:31
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.

3 participants