Skip to content

Commit 8a1a4ac

Browse files
authored
ref(issue-details): Remove outdated performance query in all events table (#89983)
Following the logic from the todo comment, this query is no longer required for performance issues since the migration to the issue platform was completed some time ago. This query is still used for regression issues though.
1 parent d42b273 commit 8a1a4ac

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

static/app/views/issueDetails/allEventsTable.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@ function AllEventsTable({organization, excludedTags, group}: Props) {
4747
groupId: group.id,
4848
});
4949

50-
const queryEnabled = group.issueCategory === IssueCategory.PERFORMANCE;
51-
const {data, isPending, isLoadingError} = useApiQuery<EventTransaction>([endpointUrl], {
50+
const isRegressionIssue =
51+
group.issueType === IssueType.PERFORMANCE_DURATION_REGRESSION ||
52+
group.issueType === IssueType.PERFORMANCE_ENDPOINT_REGRESSION;
53+
const {data, isLoading, isLoadingError} = useApiQuery<EventTransaction>([endpointUrl], {
5254
staleTime: 60000,
53-
enabled: queryEnabled,
55+
enabled: isRegressionIssue,
5456
});
5557

56-
// TODO: this is a temporary way to check whether
57-
// perf issue is backed by occurrences or transactions
58-
// Once migration to the issue platform is complete a call to /latest should be removed
59-
const groupIsOccurrenceBacked = !!data?.occurrence;
60-
6158
const eventView: EventView = EventView.fromLocation(location);
6259
if (config.usesIssuePlatform) {
6360
eventView.dataset = DiscoverDatasets.ISSUE_PLATFORM;
@@ -78,14 +75,8 @@ function AllEventsTable({organization, excludedTags, group}: Props) {
7875

7976
eventView.statsPeriod = '90d';
8077

81-
const isRegressionIssue =
82-
group.issueType === IssueType.PERFORMANCE_DURATION_REGRESSION ||
83-
group.issueType === IssueType.PERFORMANCE_ENDPOINT_REGRESSION;
84-
8578
let idQuery = `issue.id:${group.id}`;
86-
if (group.issueCategory === IssueCategory.PERFORMANCE && !groupIsOccurrenceBacked) {
87-
idQuery = `performance.issue_ids:${group.id} event.type:transaction`;
88-
} else if (isRegressionIssue && groupIsOccurrenceBacked) {
79+
if (isRegressionIssue) {
8980
const {transaction, aggregateRange2, breakpoint} =
9081
data?.occurrence?.evidenceData ?? {};
9182

@@ -126,7 +117,7 @@ function AllEventsTable({organization, excludedTags, group}: Props) {
126117
transactionName=""
127118
columnTitles={columnTitles.slice()}
128119
referrer="api.issues.issue_events"
129-
isEventLoading={queryEnabled ? isPending : false}
120+
isEventLoading={isLoading}
130121
/>
131122
);
132123
}

static/app/views/issueDetails/groupEvents.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe('groupEvents', () => {
209209
'/organizations/org-slug/events/',
210210
expect.objectContaining({
211211
query: expect.objectContaining({
212-
query: 'performance.issue_ids:1 event.type:transaction ',
212+
query: 'issue.id:1 ',
213213
}),
214214
})
215215
);

0 commit comments

Comments
 (0)