Skip to content

Commit df46d09

Browse files
committed
de-dupe type definitions
1 parent 99224ae commit df46d09

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

static/app/components/replays/breadcrumbs/errorTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function CrumbErrorTitle({frame}: {frame: ErrorFrame}) {
1616

1717
return (
1818
<Fragment>
19-
{frame.data.level ?? 'Error'}:{' '}
19+
{frame.data.level || 'Error'}:{' '}
2020
<Link
2121
to={`/organizations/${organization.slug}/issues/${frame.data.groupId}/events/${frame.data.eventId}/#replay`}
2222
>

static/app/utils/replays/hooks/useReplayData.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import {useApiQuery, useQueryClient} from 'sentry/utils/queryClient';
1111
import useFeedbackEvents from 'sentry/utils/replays/hooks/useFeedbackEvents';
1212
import {useReplayProjectSlug} from 'sentry/utils/replays/hooks/useReplayProjectSlug';
1313
import {mapResponseToReplayRecord} from 'sentry/utils/replays/replayDataUtils';
14+
import type {RawReplayError} from 'sentry/utils/replays/types';
1415
import type RequestError from 'sentry/utils/requestError/requestError';
15-
import type {ReplayError, ReplayRecord} from 'sentry/views/replays/types';
16+
import type {ReplayRecord} from 'sentry/views/replays/types';
1617

1718
type Options = {
1819
/**
@@ -41,7 +42,7 @@ type Options = {
4142
interface Result {
4243
attachmentError: undefined | RequestError[];
4344
attachments: unknown[];
44-
errors: ReplayError[];
45+
errors: RawReplayError[];
4546
fetchError: undefined | RequestError;
4647
isError: boolean;
4748
isPending: boolean;
@@ -200,7 +201,7 @@ function useReplayData({
200201
pages: errorPages,
201202
status: fetchErrorsStatus,
202203
getLastResponseHeader: lastErrorsResponseHeader,
203-
} = useFetchParallelPages<{data: ReplayError[]}>({
204+
} = useFetchParallelPages<{data: RawReplayError[]}>({
204205
enabled: enableErrors,
205206
hits: replayRecord?.count_errors ?? 0,
206207
getQueryKey: getErrorsQueryKey,
@@ -214,15 +215,15 @@ function useReplayData({
214215
(!replayRecord?.count_errors || Boolean(links.next?.results)) &&
215216
fetchErrorsStatus === 'success';
216217
const {pages: extraErrorPages, status: fetchExtraErrorsStatus} =
217-
useFetchSequentialPages<{data: ReplayError[]}>({
218+
useFetchSequentialPages<{data: RawReplayError[]}>({
218219
enabled: enableExtraErrors,
219220
initialCursor: links.next?.cursor,
220221
getQueryKey: getErrorsQueryKey,
221222
perPage: errorsPerPage,
222223
});
223224

224225
const {pages: platformErrorPages, status: fetchPlatformErrorsStatus} =
225-
useFetchSequentialPages<{data: ReplayError[]}>({
226+
useFetchSequentialPages<{data: RawReplayError[]}>({
226227
enabled: true,
227228
getQueryKey: getPlatformErrorsQueryKey,
228229
perPage: errorsPerPage,

static/app/utils/replays/replayReader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import type {
3030
incrementalSnapshotEvent,
3131
MemoryFrame,
3232
OptionFrame,
33+
RawReplayError,
3334
RecordingFrame,
3435
ReplayFrame,
3536
serializedNodeWithId,
@@ -54,7 +55,7 @@ import {
5455
isWebVitalFrame,
5556
NodeType,
5657
} from 'sentry/utils/replays/types';
57-
import type {HydratedReplayRecord, ReplayError} from 'sentry/views/replays/types';
58+
import type {HydratedReplayRecord} from 'sentry/views/replays/types';
5859

5960
interface ReplayReaderParams {
6061
/**
@@ -71,7 +72,7 @@ interface ReplayReaderParams {
7172
* Error instances could be frontend, backend, or come from the error platform
7273
* like performance-errors or replay-errors
7374
*/
74-
errors: ReplayError[] | undefined;
75+
errors: RawReplayError[] | undefined;
7576

7677
/**
7778
* Is replay data still fetching?

static/app/views/replays/types.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,6 @@ export type ReplayListRecord = Pick<
299299
| 'warning_ids'
300300
>;
301301

302-
/**
303-
* This is a result of a custom discover query
304-
*/
305-
export interface ReplayError {
306-
['error.type']: string[];
307-
['error.value']: string[]; // deprecated, use title instead. See organization_replay_events_meta.py
308-
id: string;
309-
issue: string;
310-
['issue.id']: number;
311-
['project.name']: string;
312-
timestamp: string;
313-
title: string;
314-
}
315-
316302
export type DeadRageSelectorItem = {
317303
aria_label: string;
318304
dom_element: {

0 commit comments

Comments
 (0)