Skip to content

Conversation

@cvxluo
Copy link
Contributor

@cvxluo cvxluo commented Nov 20, 2025

Add UI for the top issues experiment. Hidden behind organizations:top-issues-ui, see https://github.com/getsentry/sentry-options-automator/pull/5780

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Nov 20, 2025
@cvxluo cvxluo force-pushed the cvxluo/dynamic-grouping-very-real branch from c2355a8 to b8a87de Compare November 20, 2025 21:49
@cvxluo cvxluo force-pushed the cvxluo/dynamic-grouping-very-real branch from b8a87de to 5d232c5 Compare November 20, 2025 21:52
@cvxluo cvxluo changed the base branch from master to cvxluo/dynamic-grouping-feature-flag November 20, 2025 21:53
@getsentry getsentry deleted a comment from github-actions bot Nov 20, 2025
@cvxluo cvxluo removed the Scope: Backend Automatically applied to PRs that change backend components label Nov 20, 2025
cvxluo added a commit that referenced this pull request Nov 20, 2025
Add a feature flag for dynamic grouping experiment of top issues. See
#103773
Base automatically changed from cvxluo/dynamic-grouping-feature-flag to master November 20, 2025 22:13
@cvxluo cvxluo force-pushed the cvxluo/dynamic-grouping-very-real branch from 5d232c5 to 24ddeb2 Compare November 20, 2025 22:21
@cvxluo cvxluo changed the title feat(issues): dynamic grouping experiment feat(issues): top issues experiment Nov 20, 2025
@cvxluo cvxluo force-pushed the cvxluo/dynamic-grouping-very-real branch from 24ddeb2 to 58047e0 Compare November 20, 2025 22:23
@cvxluo cvxluo marked this pull request as ready for review November 20, 2025 22:27
@cvxluo cvxluo requested a review from a team as a code owner November 20, 2025 22:27
@cvxluo cvxluo requested a review from scttcper November 20, 2025 22:27
localStorage.removeItem(STORAGE_KEY);
}
}, 300); // Match the animation duration
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Race condition in cluster removal

handleRemoveCluster uses a timeout for animation but captures a stale clusterData closure in the callback. If multiple clusters are removed quickly, the state updates will overwrite each other, causing previously removed items to reappear. Use the functional update pattern setClusterData(prev => ...) to ensure updates are based on the latest state.

Fix in Cursor Fix in Web

} catch (error) {
setParseError(error instanceof Error ? error.message : t('Invalid JSON format'));
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Missing JSON schema validation causes crash

The JSON input validation only checks for an array, but the code expects objects with specific fields like group_ids. Entering invalid objects (e.g. missing group_ids) causes the app to crash when accessing properties of undefined. Please add schema validation to ensure required fields exist before setting state.

Fix in Cursor Fix in Web

import {useUser} from 'sentry/utils/useUser';
import {useUserTeams} from 'sentry/utils/useUserTeams';

const STORAGE_KEY = 'dynamic-grouping-cluster-data';
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Data leak across organizations in local storage

The STORAGE_KEY is static and not namespaced by the organization. If a user switches organizations, they will see the cluster data from the previous organization. This can lead to confusion and potential leakage of sensitive issue titles/descriptions across organization boundaries on shared devices. Append organization.slug to the storage key.

Fix in Cursor Fix in Web

flex-direction: column;
gap: ${space(1.5)};
`;

Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Excessive use of styled components contrary to guidelines (Bugbot Rules)

The new file defines numerous styled components (e.g., PageContainer, PageHeader, CardContainer) despite importing Container, Flex, and Heading. Sentry's frontend guidelines (AGENTS.md) explicitly state to use these Core Components for layout and typography instead of creating new styled wrappers.

Fix in Cursor Fix in Web

))}
</Flex>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Unbounded concurrent API requests causing network flood

The ClusterIssues component triggers a separate useApiQuery request for each rendered cluster to fetch issue details. When visualizing a large number of clusters (e.g., pasted from a bulk analysis), this will trigger N concurrent API requests to the issues endpoint, leading to browser stalling or rate limiting. Requests should be batched.

Fix in Cursor Fix in Web

group: previewGroupIds,
query: `issue.id:[${previewGroupIds.join(',')}]`,
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Invalid group parameter sent to issues endpoint

The API query in ClusterIssues passes a group parameter (array of IDs) to the issues endpoint. The Sentry API typically uses the query string parameter (e.g., issue.id:[...]) for ID filtering, not a top-level group parameter. This parameter is likely incorrect/ignored and should be removed to ensure correct API usage.

Fix in Cursor Fix in Web

Copy link
Member

@scttcper scttcper left a comment

Choose a reason for hiding this comment

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

makes sense for the demo. keeping it all in one file helps

@cvxluo cvxluo merged commit 643d334 into master Nov 21, 2025
47 checks passed
@cvxluo cvxluo deleted the cvxluo/dynamic-grouping-very-real branch November 21, 2025 23:02
@cvxluo cvxluo restored the cvxluo/dynamic-grouping-very-real branch November 24, 2025 23:50
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